关闭系统防火墙(没有安装防火墙也要操作,关闭了控制台防火墙,主机默认只能被访问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