关闭系统防火墙(没有安装防火墙也要操作,关闭了控制台防火墙,主机默认只能被访问22端口,其他端口仍然闭塞,ubuntu安全策略限制)

我的系统版本:ubuntu22

关闭系统防火墙操作如下:

# 开放所有端口
iptables -P INPUT ACCEPT
iptables -P FORWARD ACCEPT
iptables -P OUTPUT ACCEPT
iptables -F

# 删除防火墙
apt-get purge netfilter-persistent && reboot
或 rm -rf /etc/iptables && reboot

如果是centos

# 删除多余附件
systemctl stop oracle-cloud-agent
systemctl disable oracle-cloud-agent
systemctl stop oracle-cloud-agent-updater
systemctl disable oracle-cloud-agent-updater

# 关闭防火墙并禁止自启动
systemctl stop firewalld.service
systemctl disable firewalld.service
Logo

魔乐社区(Modelers.cn) 是一个中立、公益的人工智能社区,提供人工智能工具、模型、数据的托管、展示与应用协同服务,为人工智能开发及爱好者搭建开放的学习交流平台。社区通过理事会方式运作,由全产业链共同建设、共同运营、共同享有,推动国产AI生态繁荣发展。

更多推荐