gpt4 book ai didi

linux - 如何使该网络服务器只能由您的计算机和 server1.example.com 访问?

转载 作者:太空宇宙 更新时间:2023-11-04 05:01:44 24 4
gpt4 key购买 nike

我设置了默认配置网络服务器。现在我无法使该网络服务器只能由我的计算机和 server1.example.com 访问。

# chkconfig httpd on
# service httpd start
echo “This is a test.? > /var/www/html/index.html
# iptables -I INPUT -m state –state NEW -m tcp port 80 -j ACCEPT

我的脚本有问题。

最佳答案

您在脚本中错过了 tcp 和 -dport:

# iptables -I INPUT -m state –state NEW -m tcp port 80 -j ACCEPT

你需要尝试这个:

# iptables -I INPUT -m state –state NEW -m tcp -p tcp –dport 80 -j ACCEPT

关于linux - 如何使该网络服务器只能由您的计算机和 server1.example.com 访问?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30544343/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com