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

相关推荐
TG_yunshuguoji1 小时前
阿里云代理商:阿里云CDN访问问题怎么诊断?
运维·服务器·阿里云·云计算
Sylvia@8882 小时前
18.SELInux安全性
linux·运维·服务器
Xの哲學2 小时前
Linux NAPI 架构详解
linux·网络·算法·架构·边缘计算
碼不停提2 小时前
linux 内核架构
linux
gplitems1234 小时前
Technox – IT Solutions & Services WordPress Theme: A Practical
linux·服务器·数据库
造价女工4 小时前
视频监控系统原理与计量
网络·音视频·状态模式·消防·工程造价
Deamon Tree4 小时前
后端开发常用Linux命令
linux·运维·python
key_Go5 小时前
0.基于Centos-Stream8 搭建Openstack环境
linux·运维·centos·openstack
wacpguo5 小时前
centos 配置网络
linux·网络·centos
子燕若水5 小时前
TLS/SSL加密通信过程全解
网络·网络协议·ssl