# linux中/etc/hosts.allow和/etc/hosts.deny详解

/ 0评 / 0

# # 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:210.13.218.*:allow sshd:222.77.15.*:allow

all:218.24.129.110//他表示接受110这个ip的所有请求！

/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:deny

service network restart

linux 系统会先检查/etc/hosts.deny规则，再检查/etc/hosts.allow规则，如果有冲突 按/etc/hosts.allow规则处理

• 默认
• 护眼
• 夜晚
• Serif
• Sans