SELinux or (Security Enhanced Linux) allows you to add an additional layer of security on your files and permissions, who is allowed to write to certain areas of the system. It’s a great additional layer of security when a system is locked down, and you want to spend the time to configure it properly. If you’re setting up a server and configuring things, it can be a pain so it’s best to disable it on a new server til it’s setup and configured how you want it to be.

To disable, you can edit /etc/selinux/config and change SELINUX=enforcing to SELINUX=disabled

This works on CentOS 6 and 7.

sed -i 's/SELINUX=enforcing/SELINUX=disabled/g'/etc/selinux/config

To disable a CentOS 6 system that was booted with enforcing turned on

echo 0 >/selinux/enforce

Set a CentOS 7 system with selinux enforcing to permissive:

setenforce permissive

Get running SELinux options on CentOS 6 and 7:


More to come…