Tuesday, December 22, 2009

How to Disable SELinux

Steps to check if SELinux is enabled or disabled in RHEL 5 :

Try running command getenforce from command prompt in Red hat enterprise Linux :
[root@rhel 5 ~]# getenforce
Disabled
OR
[root@rhel 5 ~]# grep SELINUX /etc/selinux/config
# SELINUX= can take one of these three values:
SELINUX=disabled

Steps to disabled SElinux in RHEL 5

There is file called config in /etc/selinux which is used to enable/disable SElinux in RHEL5:
[root@rhel 5#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 - SELinux is fully disabled.
SELINUX=disabled
# SELINUXTYPE= type of policy in use. Possible values are:
# targeted - Only targeted network daemons are protected.
# strict - Full SELinux protection.
SELINUXTYPE=targeted
# SETLOCALDEFS= Check local definition changes
SETLOCALDEFS=0


While installing RHEL 5 linux if you haven't paid much attention then chances are, you probably have missed reading one of the installation window where installation program ask you to enable/disable SElinux. SElinux can run as enforcing or in permissive mode. If in /etc/selinux/config file selinux is set as permissive or enforcing then change it to disabled. You would need to reboot your RHEL 5 server to disable selinux. This change wouldn't work without rebooting your linux box.

No comments:

Post a Comment