※)以下の紹介ページでも記載しています。
http://kajuhome.com/server_access.shtml#n04
各デーモンへのアクセスをIPアドレスまたはドメイン名で「許可」「拒否」する事ができます。
・拒否する接続元を指定するファイルは「/etc/hosts.deny」
・許可する接続元を指定するファイルは「/etc/hosts.allow」
定義方法は「デーモン名: IPアドレス または ドメイン名」の様に指定します。
複数指定したい場合は","カンマで区切ります。
サーバデーモン接続を拒否する指定
# vi /etc/hosts.deny
#
# hosts.deny This file describes the names of the hosts which are
# *not* allowed to use the local INET services, as decided
# by the '/usr/sbin/tcpd' server.
#
# The portmap line is redundant, but it is left to remind you that
# the new secure portmap uses hosts.deny and hosts.allow. In particular
# you should know that NFS uses portmap!
sshd: ALL
in.telnetd: ALL
vsftpd: ALL
サーバデーモン接続を許可する指定
# vi /etc/hosts.allow
#
# hosts.allow This file describes the names of the hosts which are
# allowed to use the local INET services, as decided
# by the '/usr/sbin/tcpd' server.
#
sshd: 192.168.1.
in.telnetd: 192.168.1.100 , abc.co.jp
vsftpd: 192.168.1.0/255.255.255.0 EXCEPT 192.168.1.200
|