How to disable SELinux on KVM

This applies only to KVM based VPSes and dedicated servers running CentOS/RHEL based operating systems only.

Edit the SELinux config file

nano /etc/selinux/config

Set SELINUX=disabled and SELINUXTYPE=targeted, It should then 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.

Save & exit the file

Reboot the VPS/Dedicated Server and SELinux would have been disabled,


You can verify the SELinux status with the following command,


It should now return back,

SELinux status:                 disabled