Replacing TCP Wrappers in RHEL 8

https://access.redhat.com/solutions/3906701

 SOLUTION 已验证 - 已更新 2019年二月21日09:58 - 

English 

环境

  • Red Hat Enterprise Linux 8

问题

  • The TCP Wrappers package has been deprecated in RHEL 7 and therefore it will not be available in RHEL 8 or later RHEL releases.

决议

  • Firewalld can be used as a firewall level replacement for TCP Wrappers.

  • This example allows SSH for the 10.1.1.0/24 network and blocks it for all others.

firewalld

  • Firewalld operates at the firewall layer and can be used to restrict access to a given service. One approach is to create a new firewall zone for the 10.1.1.0/24 network and enable SSH in the new zone.

  • firewalld enables SSH in the default (public) zone by default. To only allow 10.1.1.0/24 SSH, first needs to be removed from the default zone. For other services, this step can be skipped.

Raw

# firewall-cmd --permanent --remove-service=ssh
  • You can now create the new zone and add the SSH service.

Raw

# firewall-cmd --permanent --new-zone=mysshzone
# firewall-cmd --permanent --zone=mysshzone --add-source=10.1.1.0/24
# firewall-cmd --permanent --zone=mysshzone --add-service=ssh
  • Then, reload the firewall to make the new configuration active.

Raw

# firewall-cmd --reload
  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值