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.
5 Answers
sestatus
will tell you if SELinux is enabled, as well as a few other characteristics.

- 45,939
- 6
- 79
- 84
-
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 02 '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:
/usr/bin/system-config-securitylevel-tui
To totally disable it.

- 453
- 2
- 5
- 13
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.

- 2,316
- 1
- 17
- 28
Open the file using following cmd
vi /etc/sysconfig/selinux
and go to the insert mode by pressing i
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# disabled - 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 - Targeted processes are protected,
# mls - Multi Level Security protection.
SELINUXTYPE=targeted
change enforcing into disabled and save and quit.

- 244,070
- 43
- 506
- 972

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

- 1
-
-
`/etc/sysconfig/selinux` is a symbolic link to `/etc/selinux/config` – Dima Chubarov Oct 02 '12 at 12:06