How to Disable SELinux on CentOS?

SELinux called Security-Enhanced Linux is a security module of Linux kernel which provides security policies on your Linux Distribution. It includes access controls for security policies. It is a set of kernel modifications which added to Linux Distributions.

How to Disable SELinux Temporarily

Following are the steps to disable SELinux on Centos. Let us check the SELinux Status with below command.

       sestatus :

SELinux status: enabled
SELinuxfs mount: /selinux
SELinux root directory: /etc/selinux
Loaded policy name: targeted
Current mode: permissive
Mode from config file: enforcing
Policy MLS status: enabled
Policy deny_unknown status: allow
Memory protection checking: actual (secure)
Max kernel policy version: 26

As per the above command SELinux is up and running. You can temporarily disable the SELinux with below command.

# setenforce 0
# setenforce Permissive

As mentiones, this command can temporarily block the SELinux. Once the server is rebooted SELinux will be enabled again.

How to Disable SELinux Permanently?

  1. You can find the configuration file of the selinux at /etc/selinux/config. We can modify the to Disable SELinux.

    # vi /etc/selinux/config
  2. Find SELinux and change it to disable.

    # SELINUX=disabled
  3. Save the file with :wq and reboot the server.

  4. Check the sestatus again. It should be disable now.

    # sestatus

Related Articles

How To Add A New IP Address In Virtualmin?

You can add an IP Address via Networking Module directly with virtualmean. To do this, you need...

Is HTML5 Supported in Your Servers?

Since HTML content has nothing to do with the web server, there are no special requirements...

How to Enable Extended Logging in Exim?

Extended Exim log is helpful in troubleshooting Exim issues on Linux Server. It allows you to add...

How to Manage Linux VPS (SSD and Traditional) From Client Area?

This article will assist you to manage your Linux VPS (SSD and Traditional) from client area...

How to Apply Linux Kernel Security Patches? Manually and Automatically without reboot?

As we know, we do receive Linux kernel updates time and time again and it is essential to update...

  • 0 Users Found This Useful

Was this answer helpful?