Disable or Enable SELinux In Centos, Fedora and Redhat

FREQUENTLY ASKED QUESTIONS (SELinux)
Q: How to Disable, Enable and Manage SELinux in Linux?

SELinux is a MAC(Mandatory Access Control) mechanism in Linux Kernel. By 
The available three SELinux modes are listed below.


Enforcing: This is the default mode. which is enforced the SELinux security policies.
Permissive: In this mode SELinux is enabled but the policies are not enforced, But warning messages are enabled. This mode is used for troubleshooting SELinux.
Disabled: SELinux is fully disables including policies.


This SELinux configuration should work in all RPM based linux distributions like Redhat(RHEL), Fedora, CentOS, etc.


HowTo Disable SELinux protection, Edit the SELinux configuration file located in directory /etc/sysconfig/selinux
[root@server ~]# 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 - SELinux is fully disabled.
#SELINUX=enforcing
SELINUX=enforcing
# SELINUXTYPE= type of policy in use. Possible values are:
#       targeted - Only targeted network daemons are protected.
#       strict - Full SELinux protection.
SELINUXTYPE=targeted


#Above is the default SELinux configuration file(SELinux is Enforced), If you need to fully disable SELinux
change the 7th line like below
SELINUX=disabled                                                       #SELinux will be disabled


Now save the selinux file. and reboot the linux.

0 comments:

Related Posts Plugin for WordPress, Blogger...

 
Design by Free WordPress Themes | Bloggerized by Lasantha - Premium Blogger Themes | Bluehost Coupons