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 Exim error-exim dead but subsys locked

Problem Statement php mail scripts were not working in Linux VPS. Error Message exim dead but...

How Do I Check Bandwidth Utilization of VPS?

Windows VPS To check/monitor usage of each Windows VPS, we have installed bandwidth meter tool...

How to create users and groups in CentOS7?

Once the Linux system is configured, adding and removing users is one of the most basic tasks...

How to Enable Plaintext Authentication in Dovecot?

Dovecot is an Open source IMAP or POP3 server used to create light-weight and high-performance...

How to install/add Softaculous in Plesk?

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