SSH接続できるアクセス元を制限する

※ホスト名だとあんまし威力ないんだけどね。やらないよりはましかな?


# cp /etc/hosts.allow /etc/hosts.allow.backup
# 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 : .example.ne.jp


# cp /etc/hosts.deny /etc/hosts.deny.backup
# 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

これで、.example.ne.jpからのみ、SSH接続可能となる。