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
  • 0 Users Found This Useful

Was this answer helpful?

Related Articles

Fix cPanel Error -The Email Account Already Exists

Sometimes, you add an email account from cPanel, and you get an error message The Email Account...

Can I open APN port 2195 on my VPS?

You will get full administrative control of your VPS, therefore you can surely open/close any...

How to Upgrade PHP Version in cPanel/WHM Server?

Following article will assist you to upgrade PHP version in cPanel/WHM server. This article is...

How to install/add Softaculous in Plesk?

Softaculous is software that auto-install web applications with one click. There is a wide range...

How to configure Exim outgoing IP address from WHM?

By Default, All the outgoing emails from the Exim will be sent from the server’s primary IPv4...