home

Tags

ssh限制IP又一贴.转自gamearena

February 24th, 2007

以前那个贴是是TCP Wrappers的过滤机制,它由tcpd程序控制,有点类似TCP包的检验程序,这个程序的主要参数文件在/etc/hosts.allow及/etc/hosts/hosts.deny两个文件中,必须要某个软件支持tcpd(TCP Wrappers)的功能才能接受TCP Wrappers的校验。\r

数据包的校验顺序首先是/etc/hosts.allow,然后才是/etc/hosts/hosts.deny。所以我们通常的设置方法是:在/etc/hosts/hosts.allow里针对某些服务与数据包来源开启它们的使用权限;在/etc/hosts/hosts.deny里将该服务的其它来源过滤掉。\r

注意:如果您在/etc/hosts/hosts.allow里没有设置,那么TCP Wrappers默认的动作是allow(通过校验并进入主机)。

[more…]