1、查看SELinux狀態:getenforce
Enforcing(啟動)
disable(禁用)
1、禁用SELinux(重啟后依然生效)
修改 vi /etc/sysconfig/selinux
[root@developer ~]# vi /etc/selinux/config
# This file controls the state of SELinux on the system. # SELINUX= can take one of these three values: # enforcing - SELinux security policy is enforced. # permissive - SELinux PRints warnings instead of enforcing. # disabled - No SELinux policy is loaded. SELINUX=enforcing
# SELINUXTYPE= can take one of these two values: # targeted - Targeted processes are protected, # mls - Multi Level Security protection. SELINUXTYPE=targeted
更改其中的SELINUX項的值就可以關閉和啟用SELinux服務了。 修改成 SELINUX=disable 禁用SeLinux 修改成 SELINUX=enforcing 使用SeLinux 或 vi /etc/selinux/conf set SELINUX=disabled
2、不重啟讓其生效
/usr/sbin/setenforce 0 立刻關閉 SELINUX
/usr/sbin/setenforce 1 立刻啟用 SELINUX
3,加到系統默認啟動里面
echo "/usr/sbin/setenforce 0" >> /etc/rc.local
echo "/usr/sbin/setenforce 0" >> /etc/rc.local
新聞熱點
疑難解答