kylin系统永久关闭iptables

1 关闭iptables, 并且相关规则写入文件firewall.rules

sudo iptables-save > /root/firewall.rules

iptables -X

iptables -t nat -F

iptables -t nat -X

iptables -t mangle -F

iptables -t mangle -X

iptables -P INPUT ACCEPT

iptables -P FORWARD ACCEPT

iptables -P OUTPUT ACCEPT

iptables-restore < /root/firewall.rules

2 开启执行恢复防火墙规则的脚本(关闭防火墙)

echo '/sbin/iptables-restore /root/firewall.rules' >>/etc/rc.local

3 由于kylin是用test登录的,所以修改rc.local的权限等

chmod 777 /etc/rc.local

chown test /etc/rc.local

chgrp test /etc/rc.local

4 重启,查看ssh能否连上主机

reboot

ssh test@ip

相关推荐
Sheffield1 小时前
Docker的跨主机服务与其对应的优缺点
linux·网络协议·docker
Sheffield9 小时前
Alpine是什么,为什么是Docker首选?
linux·docker·容器
Johny_Zhao1 天前
centos7安装部署openclaw
linux·人工智能·信息安全·云计算·yum源·系统运维·openclaw
haibindev1 天前
在 Windows+WSL2 上部署 OpenClaw AI员工的实践与踩坑
linux·wsl2·openclaw
0xDevNull2 天前
Linux切换JDK版本详细教程
linux
进击的丸子2 天前
虹软人脸服务器版SDK(Linux/ARM Pro)多线程调用及性能优化
linux·数据库·后端
茶杯梦轩2 天前
从零起步学习RabbitMQ || 第二章:RabbitMQ 深入理解概念 Producer、Consumer、Exchange、Queue 与企业实战案例
服务器·后端·消息队列
Johny_Zhao4 天前
OpenClaw安装部署教程
linux·人工智能·ai·云计算·系统运维·openclaw
YuMiao4 天前
gstatic连接问题导致Google Gemini / Studio页面乱码或图标缺失问题
服务器·网络协议