Security-Enhanced Linux (SELinux) is a security module specifically made for the Linux kernel, which enables features that support security policies for access control, including mandatory access control (MAC).Released in January 1998, it is written in the C programming language and has been a part of the Linux mainline since 2003, when version 2.6 which was released.
In this article I will show how to disable SELinux on CentOS 6.9 machine. Sometime you may hit a problem when try to install software on Linux machine if SELinux is enable.
Steps to Disable SELinux on CentOS 6.9
Follow the below steps to disable SELinux.
1. First of all check the SELinux status:
# sestatus SELinux status: enabled SELinuxfs mount: /selinux Current mode: enforcing Mode from config file: enforcing Policy version: 24 Policy from config file: targeted
2. Now disable SELinux immediately without reboot.
# setenforce 0
3. Disable SELinux on CentOS 6.9 permanently editing below file.
# vi /etc/sysconfig/selinux
Change “SELINUX=enforcing” to “SELINUX=disabled”.
# 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
4. Now finally reboot your system.