在linux
中,许多网络服务针对客户机提供访问控制机制,而tcp wrappers
是应用服务与网络之间的一道特殊的防线,提供额外的安全保障。
名称 | ip地址 |
---|---|
host01 | 192.168.28.128 |
host02 | 192.168.28.129 |
host03 | 192.168.28.130 |
[root@host01 ~]# ls /etc/hosts.* /etc/hosts.allow /etc/hosts.deny
[root@host01 ~]# vim /etc/hosts.allow sshd:192.168.28.129 [root@host01 ~]# vim /etc/hosts.deny sshd:192.168.28.129 sshd:192.168.28.130
129
登录[root@host02 ~]# ssh root@192.168.28.128 root@192.168.28.128's password: last login: tue sep 17 02:23:49 2019 from 192.168.28.129 [root@host01 ~]# logout connection to 192.168.28.128 closed.
130
登录[root@host03 ~]# ssh root@192.168.28.128 ssh_exchange_identification: read: connection reset by peer
1.首先检查/etc/hosts.allow
文件,匹配到策略,则允许访问。
2.否则检查/etc/hosts.deny
文件,匹配到策略,则拒绝访问。
3.若是都找不到相匹配的策略,则默认允许访问。
如对本文有疑问, 点击进行留言回复!!
linux下文本编辑器vim的使用方法(复制、粘贴、替换、行号、撤销、多文件操作)
网友评论