![我想阻止对所有 http 的访问](https://linux22.com/image/168582/%E6%88%91%E6%83%B3%E9%98%BB%E6%AD%A2%E5%AF%B9%E6%89%80%E6%9C%89%20http%20%E7%9A%84%E8%AE%BF%E9%97%AE.png)
在 Linux 系统上,我需要阻止对除 Web 服务器 192.168.1.253 之外的所有 http 和 https 流量的出站访问。系统还应该阻止除 ssh 之外的所有传入流量。
我该如何配置这个?
答案1
选项 1:拔掉系统电源
选项 2:使用tcp_wrappers
编辑/etc/hosts.allow
以具有
# allow all ssh traffic
SSHD : ALL : ALLOW
# allow specific http
HTTP: 192.168.1.253/255.255.255.0
# allow specific https
HTTPS: 192.168.1.253/255.255.255.0
编辑/etc/hosts.deny
以具有
# have console access to your system before putting this in hosts.deny
# you have been warned
# this will disable all traffic, and require explicit definition in hosts.allow for **anything** to work
ALL : ALL
人 TCPD了解更多信息。