临时和永久关闭Selinux——新手上路

临时关闭:

[root@localhost ~]# getenforce
Enforcing

[root@localhost ~]# setenforce 0
[root@localhost ~]# getenforce
Permissive

清除已有iptables规则

iptables -F:清楚规则链中已有的条目;清除iptables内置规则
iptables -X:清除iptables自定义规则;删除用户自定义的规则链
iptables -Z:清空规则链中的数据包计算器和字节计数器;
iptables -L:显示规则链中已有的条目

永久关闭:

[root@localhost ~]# vim /etc/sysconfig/selinux

SELINUX=enforcing 改为 SELINUX=disabled

重启服务reboot

猜你喜欢

转载自blog.csdn.net/VickHUC/article/details/82586935