HostOnNet Blog

How to disable SELinux

selinux-linux

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:

SELINUX=disabled

To quickly check SELinux status by running following commands.

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

Or

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

Or

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.