centos-限制ssh访问

hosts.allow和hosts.deny规则的执行者为TCP wrappers,对应守护进程为tcpd;而tcpd执行依赖于程序使用了libwrap库。

也就是说:hosts.allow和hosts.deny支持且只支持使用了libwrap库的服务。

查看程序是否使用libwarp

strings /usr/sbin/sshd | grep hosts_access
ldd /usr/sbin/sshd | grep libwrap

hosts.allow

sshd:192.168.1.2:allow

hosts.deny

sshd:ALL
原文地址:https://www.cnblogs.com/kylingx/p/11718225.html