Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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

4 Answers 4

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

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

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:

/usr/bin/system-config-securitylevel-tui

To totally disable it.

share|improve this answer

Your Answer

 
discard

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.