How to disable SELinux on KVM

Note: This applies only to KVM and dedicated servers. CentOS/RHEL based operating systems only.

Step 1 : Edit the SELinux config file

nano /etc/selinux/config

Step 2 : Set SELINUX=disabled and SELINUXTYPE=targeted

It should look like this :

# 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.

Step 3 : Save the file

Step 4 : Reboot the VPS and SELinux would have been disabled.

Last modified: March 16 2017 13:43:03