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

Virtual Machine with CentOS 5 32-Bit OS Does not Address Physical Memory More Than 3 GB

Recently we came across very strange issue wherein Linux virtual machine with Centos 5.X 32 Bit...

How to use the Rsync command in linux?

Rsync is an important command in Linux and used to synchronize or copy the files and directories...

How to Install Java on Ubuntu 18.04 ?

Java is a programming language developed by Sun Microsystems. There are lots of applications and...

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...

How to install ISPConfig on Debian 10?

ISPConfig is an Open-source Hosting Control Panel for Linux. It is used widely as it is free of...

  • 0 Users Found This Useful

Was this answer helpful?