Disable SELinux Permanently


SELinux can  be disabled temporarily and permanently based on our requirement.

Here I will show how to disable SELinnux temporarily and permanently.

To Disable SELinux Temporarily:

Login as root and run following command

$ setenforce 0

By default SELinux is enabled if it’s installed.

If we run setenforce 0 command SELinux will disabled until next reboot.

To Disable SELinux permanently:

To disable SELinux permanently we need to update file /etc/sysconfig/selinux.

Default configurations in /etc/sysconfig/selinux looks like below after disabling 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.
# SELINUXTYPE= can take one of these two values:
# targeted - Only targeted network daemons are protected.
# strict - Full SELinux protection.

The only line we modify in above config is SELINUX=disabled. This configuration will disable SELinux on boot.



Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s