查看SELinux 的状态
查看SELinux命令:getenforce;
•enforcing:强制模式,代表 SELinux 运作中,且已经正确的开始限制 domain/type 了;
•permissive:宽容模式:代表 SELinux 运作中,不过仅会有警告讯息并不会实际限制 domain/type 的存取。这种模式可以运来作为 SELinux 的 debug 之用;
•disabled:关闭,SELinux 并没有实际运作。
# enforcing 开启selinux保护
# permissive 未开启但允许 不保护 给root提示警告
# disabled 不启用
永久关闭
vim /etc/sysconfig/selinux etc/selinux/config
把SELINUX=enforcing 改为 SELINUX=disabled .
然后重启
临时关闭SELinux。
如果你仅仅只是想临时关闭,可以输入
setenforce 0