Saturday 6 June 2009

How To Disable SELinux

1. Log in as root.

2, Type setenforce 0 to disable.

3. Type setenforce 1 to re-enable.

NOTE: To turn off SELinux add selinux=0 to the command line.

NOTE: To turn SELinux off permanently, you can specify the SELinux mode using the configuration file /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=enforcing
# SELINUXTYPE= type of policy in use. Possible values are:
# targeted - Only targeted network daemons are protected.
# strict - Full SELinux protection.
SELINUXTYPE=targeted
Setting the value to enforcing is the same as adding enforcing=1 to your command line when booting the kernel to turn enforcing on, while setting the value to permissive is the same as adding enforcing=0 to turn enforcing off. Note that the command line kernel parameter overrides the configuration file.

However, setting the value to disabled is not the same as the selinux=0 kernel boot parameter. Rather than fully disabling SELinux in the kernel, the disabled setting instead turns enforcing off and skips loading a policy.

No comments:

Post a Comment