Disabling SELinux


Security-Enhanced Linux (SELinux) is a Linux feature that provides a mechanism for supporting access control security policies, including United States Department of Defense style mandatory access controls, through the use of Linux Security Modules (LSM) in the Linux kernel.

Temporarily switch off enforcement
You can switch the system into permissive mode with the following command

echo 0 >/selinux/enforce

To switch back into enforcing mode

echo 1 >/selinux/enforce

To check what mode the system is in

sestatus

Fully Disabling SELinux
To fully disable SELinux you need to modify /etc/selinux/config file. Run following commands to fully disable SELinux

sed -i 's/^SELINUX=/#SELINUX=/g' /etc/selinux/config
echo 'SELINUX=disabled' >> /etc/selinux/config

You need to restart the machine to reflect the changes.

Above methods should work on CentOS, RedHat and on Fedora.

Subscribe / Share

Article by Vidyadhar

My name is Vidyadhar Sarmalkar & I work as a consultant and have done RHCE & CCNA.
Vidyadhar tagged this post with: , , , , , , , , , , , , , , , , , , , , Read 229 articles by

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="" highlight="">

Notify me of followup comments via e-mail. You can also subscribe without commenting.

rss twitter facbook

Categories

Archives

Buffer