Insight: Tutorial To Disable SELinux On CentOs 7
What Is SELinux ?
Security Enhanced Linux or SELinux is a Linux kernel security module. SELinux allows users and administrators more control over access control. SELinux access controls are determined by a policy loaded on your system.
By default in CentOS 7, SELinux is enabled and also in enforcing mode. In this tutorial, we are going to show you the easy tutorial to disable SELinux on CentOS 7.
Easy Tutorial To Disable SELinux On CentOS 7
You will see something like this:
SELinux status: enabled SELinuxfs mount: /sys/fs/selinux SELinux root directory: /etc/selinux Loaded policy name: targeted Current mode: enforcing Mode from config file: enforcing Policy MLS status: enabled Policy deny_unknown status: allowed
To permanently disable SELinux on your CentOS 7 system, Go through the following steps:
At first, Open the
/etc/selinux/config file and change the
SELINUX mod to
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
Now, save the file and shut down your system with the command below:
sudo shutdown -r now
Boot your system and verify the change with the
The output should look something like this:
SELinux status: enabled SELinuxfs mount: /sys/fs/selinux SELinux root directory: /etc/selinux
sudo setenforce 0
This change is only applicable for the current session.
Important note: It is recommended to put SELinux in enforcing mode.