How to disable SELinux


We can use the setenforce command to disable SELinux

# setenforce 0

The ‘setenforce’ command may be used to switch between Enforcing and Permissive modes

To make it permanant, edit /etc/selinux/config file, run:

# vi /etc/selinux/config

Update the configuration file as follows:


To quickly check SELinux status by running following commands.

root@serverxx [~]# cat /etc/sysconfig/selinux


root@serverxx [~]# getenforce
root@serverxx [~]#


root@serverxx [~]# sestatus
SELinux status:                 disabled
root@serverxx [~]#

About Annie

I've been working in Technical Section for over 10 years in a wide range of tech jobs from Tech Support to Software Testing. I started writing blog for my future reference and useful for all.
Posted in Linux

  • On CentOS 6.5 servers even SSH key authentication won’t work with out disabling SELinux. Disabling SELinux should be first step during server setup.