FreeBSD/TCPWrapper

TCPWrapper

dokuwiki.fl8.jp掲載済

inetd(スーパーデーモン)から起動されるデーモンのアクセス制御ができちゃう優れもんである。tcpdでトータル的に管理ができ非常に優れたセキュリティツールである。 最近のFreeBSDではデフォルトでインストールされている。

環境

TCPWrapperでアクセス制限をかけるには

例えば、Proftpdのin.proftpdようにデーモンディレクトリに無いモジュールについては、tcpdで一括制御できない。したがって、/usr/libexecにin.proftpdを移動してデーモンディレクトリから起動してラッパーの制御を行う。

# mv /usr/local/sbin/in.proftpd /usr/libexec

/etc/inetd.conf

tcpdで一括制御

telnet stream tcp nowait root /usr/libexec/tcpd in.telnetd

デーモンディレクトリを指定して制御

ftp stream tcp nowait root /usr/libexec/in.proftpd in.proftpd

/etc/hosts.allow

ALL : 127.0.0.1 : allow       ローカルホストからのアクセスは全て許可
ALL : 192.168.1. : allow    家庭内LANからのtelnetは全て許可
in.proftpd : ALL : allow      ftp接続は全て許可  
ALL : ALL : deny              残りは全て拒否

確認コマンド

# /usr/sbin/tcpdchk
# tcpdmatch ssh localhost

inetdの再起動

# kill -HUP `cat /var/run/inetd.pid`