disable SELinux SL6 scientific linux 6

por | 16 mayo, 2011
By default SL 6 enables SELinux, and as far as I know you can’t choose to not have it during the install process (correct me if I’m wrong).

SELinux is not for everyone and it can cause headaches for certain applications. I’ve had trouble before with permission settings, checking, and rechecking my setup only to find that nothing was wrong at all, SELinux was blocking it and wasn’t configured.

Disabling or enabling it is easy though.

Check if your system has it on:

CODE
cat /etc/selinux/config

# 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= can take one of these two values:
# targeted – Only targeted network daemons are protected.
# strict – Full SELinux protection.
SELINUXTYPE=targeted

Set it to whatever you want. After you do this, you must reboot.

If you don’t want to reboot, this is how you temporarily disable it, and you need to be root:

CODE
echo 0 >/selinux/enforce

Verify if it works by doing

CODE
cat /selinux/enforce

0 is disabled, 1 is enabled.