Solaris 付属 tcp wrapper 設定
TCP Wrapper を使いたい時の設定
Solaris 9 (以降) には、tcp wrapper が付いている。 使うには設定が必要です。
/etc/default/inetd に、次の1行を追加
ENABLE_TCPWRAPPERS=YES
/etc/hosts.allowを以下を書いたファイルに置き換える.
ALL : localhost 127.0.0.1 [::1] : allow sshd : <適切なIPアドレス> : allow ALL : PARANOID : RFC931 20 : deny sendmail : localhost : allow sendmail : ALL : deny ALL : ALL : deny
/etc/hosts.deny を以下を書いたファイルに置き換える
ALL : ALL EXCEPT LOCAL
(Solaris 9 あるいは 9 以前での設定) ついでに、/etc/inetd.conf は 次のように変更する.要するに、使わないものはすべてコメントアウト
# ftp stream tcp nowait root /usr/local/sbin/tcpd in.ftpd # telnet stream tcp nowait root /usr/local/sbin/tcpd in.telnetd # shell stream tcp nowait root /usr/local/sbin/tcpd in.rshd # login stream tcp nowait root /usr/local/sbin/tcpd in.rlogind # exec stream tcp nowait root /usr/local/sbin/tcpd in.rexecd # finger stream tcp nowait nobody /usr/local/sbin/tcpd in.fingerd
もし、特定のサービスを有効にしたいときは、/etc/inetd.conf は、次の例を 参考に設定する(Solaris 9 での設定例)。
ftp stream tcp6 nowait root /usr/local/sbin/tcpd /usr/sbin/in.ftpd -a
テスト法
設定したら
tcpdmatch process_name address (e.g.: tcpdmatch in.tftpd 127.0.0.1)
でテストする.
/usr/local/sbin/tcpdmatch in.telnetd xxx.yyy.zzz.ddd /usr/local/sbin/tcpdmatch in.sshd xxx.yyy.zzz.ddd「xxx.yyy.zzz.ddd」の部分は適切な IP アドレス