Interview Prep/Linux/Firewalls, MAC & Compliance

Why should you never set SELinux to disabled, even temporarily?

IntermediateProductionFirewalls, MAC & Compliance
Answer

Booting with SELinux disabled means files created during that time get no labels. When you re-enable it, those files cause denials everywhere until a full relabel (touch /.autorelabel && reboot), which can take a long time on large filesystems. Use setenforce 0 (permissive) for short debugging instead, or make a single domain permissive: semanage permissive -a httpd_t. On RHEL 9, SELINUX=disabled in /etc/selinux/config no longer fully disables SELinux (it only skips loading the policy); a full disable needs selinux=0 on the kernel command line.

All Linux questions Roadmap: Linux

More on Firewalls, MAC & Compliance