Menu

How to Permanently Disable SELinux on CentOS 7

1 min read March 29, 2017 at 10:36pm on Tutorials

To permanently disable SELinux on CentOS 7, login as root via SSH and edit the following file:

vi /etc/selinux/config

The file contents 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 - No SELinux policy is loaded.
SELINUX=enforcing
# SELINUXTYPE= can take one of these two values:
# targeted - Only targeted network daemons are protected.
# strict - Full SELinux protection.
SELINUXTYPE=targeted

Change the line from:

SELINUX=enforcing

to

SELINUX=disabled

Save the file. Then reboot your system for the changes to take effect.

You can check the status of SELinux by using the command:

sestatus

Alternatively, you may disable SELinux temporarily by running this command as root:

echo 0 > /selinux/enforce

Get started today. SIGN UP

Services

Client

Copyright Kazila 2017 © All Rights Reserved