TCP访问控制---TCP Wrapper基础使用手册

snow chuai汇总、整理、撰写—2020/2/28


安装与使用TCP Wrapper
1) 安装软件
[root@srv1 ~]# yum install tcp_wrappers -y
2) 确认服务包含libwrap.so才能够被TCP Wrapper管理 [root@srev1 ~]# ldd /usr/sbin/sshd | grep wrap libwrap.so.0 => /lib64/libwrap.so.0 (0x00007f01b4e2a000)
3) 仅允许192.168.10.0/24网络段能够访问sshd [root@srv1 ~]# vim /etc/hosts.deny sshd: ALL # 拒绝所有连接
[root@srv1 ~]# vim /etc/hosts.allow sshd: 192.168.10. # 仅允许指定的网络段访问
4) 仅允许client.1000cc.net主机访问vsftpd [root@srv1 ~]# vim /etc/hosts.deny vsftpd: ALL
[root@srv1 ~]# vim /etc/hosts.allow vsftpd: client.1000cc.net>
5) 仅允许client.1000cc.net以及192.168.10.0/24网络段的主机能够访问所有服务 [root@srv1 ~]# vim /etc/hosts.deny ALL: ALL
[root@srv1 ~]# vim /etc/hosts.allow ALL: client.1000cc.net 192.168.10.0

 

如对您有帮助,请随缘打个赏。^-^

gold