Initial CentOS 7, close the entangled selinux

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.