4

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 5

4

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

3
  • can't run it, no command found
    – Marcin
    Oct 19, 2010 at 12:04
  • Then it certainly isn't enabled, since it can't be enabled without other utilities found in the same package. Oct 19, 2010 at 14:06
  • @Marcin It's in the policycoreutils package, which you should install on any system where SELinux will be in use. Oct 2, 2012 at 12:51
2

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.

2

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.

1

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.

0
0

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

2
  • its not under my dist, doesn't mean its not installed ?
    – Marcin
    Oct 19, 2010 at 12:05
  • /etc/sysconfig/selinux is a symbolic link to /etc/selinux/config Oct 2, 2012 at 12:06

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .