centos 关闭selinux

将SELINUX配置文件设置为 disabled 模式,禁用SELinux

vim /etc/selinux/config

SELINUX=disabled

使用sed

sed -i 's#SELINUX=enforcing#SELINUX=disabled#g' /etc/selinux/config

验证

[root@MongoDB ~]# grep "SELINUX=disabled" /etc/selinux/config  
SELINUX=disabled

然后reboot重启生效

 工作中linux不能重启     命令先临时关闭

getenforce   查看当前selinux的级别状态

配置好配置文件,使用命令临时生效

setenforce 0 #使配置立即生效

原文地址:https://www.cnblogs.com/mingerlcm/p/10655402.html