Original: Used centos6.x version of the, CentOS7 out for a long time has not been used, now learning architect learning to use the CentOS 7 version, each use will encounter some of the problems that do not know. Record down the process and learn some of the pits encountered.
* System version: CentOS Linux release 7.3.1611 (Core)
* System kernel: 3.10.0-514.el7.x86_64
#获取selinux状态信息
[Email protected] ~]# Getenforce
Enforcing
#临时关闭selinux, the same as the original version.
[Email protected] ~]# Setenforce 0
[Email protected] ~]# Getenforce
Permissive
#问题就是在修改配置文件
#按照CentOS 6 To modify the configuration file location:/etc/sysconfig/selinux
[Email protected] ~]# sed-i "S#selinux=enforcing#selinux=disabled#g"/etc/sysconfig/selinux
#一直以为这样就是可以了, no check. Until the service cobbler, Zabbix always error problem, check the log only found that the original SELinux no
Shut up, crazy. Modified/etc/sysconfig/selinux did not take effect, then Baidu query found that there is such a command sestatus.
[Email protected] conf.d]# Sestatus
SELinux status:enabled
SELINUXFS Mount:/sys/fs/selinux
SELinux root directory:/etc/selinux
Loaded Policy name:targeted
Current Mode:permissive
Mode from config file:enforcing
Policy MLS status:enabled
Policy Deny_unknown status:allowed
Max Kernel Policy version:28
#测试将原来的修改/etc/sysconfig/selinux,selinux status changed to enforcing
#然后将/etc/selinux/config,selinux Status modified to Disabled
[Email protected] ~]# sed-i "S#selinux=enforcing#selinux=disabled#g"/etc/selinux/config
#重启
[email protected] ~]# reboot
#再次获取状态, it's closed.
[Email protected] ~]# Getenforce
Disabled
#确认已经关闭了
[Email protected] ~]# Sestatus
SELinux status:disabled
It 's a lot of trouble not to close SELinux.
Initial CentOS 7, close the entangled selinux