How do I disable SELinux?

Important Notes:

Disabling SELinux is done from the command line in both Fedora and CentOS distributions of Linux.

Getting Started:

  1. Log into your server using SSH

  2. Execute the following command, it will tell you the status of selinux :

    If you see that SELinux is enabled, follow the rest of this guide carefully. Otherwise, SELinux is already disabled on your server.

  3. Issue the following command to begin to disable SELinux:

    [root@hostname]#setenfore 0
  4. Now we need to edit the SELinux configuration file to prevent SELinux from starting at boot.  Edit /etc/selinux/config by issuing the following command:

    [root@hostname]#vi /etc/selinux/config

    Feel free to use any text editor you like, I use vi because I know it.  We will be posting a guide on using vi soon.

  5. You will need to edit your configuration file to look like the following:

    # 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.
    # SELINUXTYPE= type of policy in use. Possible values are:
    # targeted - Only targeted network daemons are protected.
    # strict - Full SELinux protection.

    After saving the modified configuration file, the changes will take effect on the server after a reboot.  When the server comes back online, it should no longer be using SELinux

This article has been provided by Codero Hosting, the leading provider of reliable dedicated, managed and cloud hosting services. Need more information on this topic or to learn more about Codero’s hosting services please visit www.codero.comchat with us online or give us a call at 866-2-CODERO.


Posted in
Last update:
2015-12-03 20:39
Average rating:0 (0 Votes)