Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am trying to check if my selinux is disabled/enabled and can't find its config file, why its like that and what should I do to disable it.

share|improve this question
up vote 3 down vote accepted

sestatus will tell you if SELinux is enabled, as well as a few other characteristics.

share|improve this answer
can't run it, no command found – Marcin Oct 19 '10 at 12:04
Then it certainly isn't enabled, since it can't be enabled without other utilities found in the same package. – Ignacio Vazquez-Abrams Oct 19 '10 at 14:06
@Marcin It's in the policycoreutils package, which you should install on any system where SELinux will be in use. – Michael Hampton Oct 2 '12 at 12:51

To change the SELinux to disable you can use the below command:

setenforce 0

While this does not replace the config file it will put SELinux into permissive mode until the next reboot, meaning that SELinux is running and logging but not actually controlling permissions.

You can as well try the command:


To totally disable it.

share|improve this answer

The following command:

yum provides /etc/selinux/config

will tell you which package does the file belong to and whether the package has been installed. Normally it would be some selinux-policy package.

If it wasn't installed you can install it with yum install.

If it is reported as installed but is absent in the filesystem then something is very wrong with the system.

share|improve this answer

The selinux configuration file path under CentOS is /etc/sysconfig/selinux.

share|improve this answer
its not under my dist, doesn't mean its not installed ? – Marcin Oct 19 '10 at 12:05
/etc/sysconfig/selinux is a symbolic link to /etc/selinux/config – Dmitri Chubarov Oct 2 '12 at 12:06

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.