查看SELinux状态:
1、如果SELinux status参数为enabled或者getenforce显示Enforcing即为开启状态
[root@212 ~]# sestatus -v SELinux status: enabled SELinuxfs mount: /selinux Current mode: enforcing Mode from config file: enforcing Policy version: 24 Policy from config file: targeted
[root@212 ~]# getenforce Enforcing
关闭SELinux:
1、临时关闭(不用重启机器)
[root@212 ~]# setenforce 0
2、修改配置文件需要重启机器:
[root@212 ~]# 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=disabled # SELINUXTYPE= can take one of these two values: # targeted - Targeted processes are protected, # mls - Multi Level Security protection. SELINUXTYPE=targeted
将SELINUX=enforcing改为SELINUX=disabled