Table of Contents

SELinux - How to Configure SELinux in Linux



Commands

Command Note supplement
getenforce Check SELinux Enforcing ← Enable SELinux
Permissive ← DisableSELinux
setenforce 0 Disable SELinux
setenforce 1 Enable SELinux


Configuration

/etc/selinux/config (RHEL/CentOS7)
/etc/sysconfig/selinux (RHEL/CentOS5,6)

# 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