How do I turn off SELINUX in Redhat or CentOS?

Run the following command to check if SELinux is running:
# getenforce

You can effectively disable it by running the following command
# setenforce Permissive

This will put selinux in a passive mode until the machine is rebooted. If you would like to permanently alter the attributes of selinux, view the SELINUX= line in /etc/sysconfig/selinux.

Was this helpful?