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

How to install NodeJS on Centos with cPanel?

NodeJS is an open-source and cross-platform server environment. It is a JavaScript runtime built...

How to install IonCube Loader on CentOS 7 Manually?

Ioncube is a PHP module which protects the PHP application's source code from being viewed from...

How to reset Magento admin user password?

In this article, we will show you how to reset your Magento admin password. There are two methods...

Fix :: Linux SSH error "connection refused"

Problem Statement Can't connect to a Linux server(Debian Flavour) via SSH. Error Message...

Do you have any limits for setting up Cron jobs or schedule tasks?

Windows Shared Hosting Plans:We do not offer cron jobs in Windows shared hosting plans. Linux...