当前位置: 移动技术网 > 科技>操作系统>Linux > Linux TCP Wrappers

Linux TCP Wrappers

2019年10月08日  | 移动技术网科技  | 我要评论

centos-logo

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.若是都找不到相匹配的策略,则默认允许访问。

如对本文有疑问, 点击进行留言回复!!

相关文章:

验证码:
移动技术网