可能返回结果有三种:Enforcing、Permissive 和 Disabled。
Disabled 代表 SELinux 被禁用,Permissive 代表仅记录安全警告但不阻止可疑行为,Enforcing 代表记录警告且阻止可疑行为。
目前常见发行版中,RHEL 和 REDHAT 默认设置为 Enforcing,其余的如 openSUSE 等为 Permissive。
setenforce [ Enforcing | Permissive | 1 | 0 ]
setenforce 0 ##为0设置SELinux 成为permissive模式
##为1设置SELinux 成为enforcing模式
2、永久停止SELinux服务,修改配置文件,重启机器:
修改/etc/selinux/config 文件
将SELINUX=enforcing改为SELINUX=disabled
重启机器即可
一般使用第二种方法进行永久停止服务。
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/30146442/viewspace-2089085/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/30146442/viewspace-2089085/