In this post, I will explain you the how to disable SELINUX on Redhat or CentOS Operating system. Before going to main work first we need to understand what is SELINUX and how its work on Linux enviorement.
Security-enhanced Linux (SELINUX): SELinux is know as Security enhanced linux system which is the security feature of the Linux kernel system. It is define the security Policy which makes system proctative agaginst the misconfiguration of the daemons. SELinux running in 3 modes which is disabled, enabled and permissive. We will explain these mode in configuration steps.
How to disable SELinux on Linux system:
1. In the first step you can check the current status of SELinux. To do this please run the below command.
[redhat]# getenforce
Enabled
"getenforce" command is used for checking the current status of SELinux.
2. As you see on my machine when I run the above command my SElinux is enabled, So in this step we will change the SELinux mode.
[redhat]# vi /etc/sysconfig/selinux
# 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
Normally selinux configuration file you can found on the above location. You can edit the SELINUX entry to disabled. All the command is run by super user "root" only.
3. Once you change the entry in SELinux configuration file then for permanent effect you need to take a reboot of the system.
[redhat]#init 6
Once you reboot the server all the configuration files changes has been done.
4. In the last step you will run the "getenforce" command again to verify the new status of SELinux.
[redhat]# getenforce
Disabled
If you comparison the both step 1 and this step output you can found that SELinux policy is not disabled on the Linux operating system.
No comments:
Post a Comment