SELinux mode

Whether SELinux refuses and logs disallowed accesses (enforcing), only logs them (permissive), or is off (disabled).

In more detail

setenforce switches between enforcing and permissive until the next boot. The boot mode comes from the SELINUX line of /etc/selinux/config, unless the kernel command line has enforcing=0 or selinux=0. Coming back from disabled needs a full relabel of the file system.

Examples

setenforce 1
sed -i 's/^SELINUX=.*/SELINUX=enforcing/' /etc/selinux/config

Related terms

Taught in

References

Certification courses