How To Disable SELinux Temporarily or Permanently in CentOS, RHEL, Fedora – POFTUT

How To Disable SELinux Temporarily or Permanently in CentOS, RHEL, Fedora

SELinux is very powerful security mechanism for Linux distributions. Distributions like CentOS, RHEL or Fedora comes SELinux enabled by default. In some situations we do not need SELinux protection especially in end user systems. In this tutorial we will look how to disable SELinux temporarily or Permanently.

List SELinux Status

First step is getting information about SELinux status. We can get and list SELinux status with the sestatus command.

List SELinux Status

List SELinux Status

We can see from first line of output that the SELinux status is enabled

Disable SELinux Temporarily

There is different ways to disable SELinux. Disabling SELinux temporarily work only for current run. After the system is rebooted SELinux configuration will revert to the persistent one and the SELinux will be enabled. We can disable with the following ways. All of them requires root privileges.

OR

OR

Disable SELinux Permanently

The best way to get rid of from SELinux is disabling it permanently. We should save configuration. This will make configuration effective between reboots. We have  different ways to accomplish this. All of them requires root privileges.

Change SELINUX=enforcing line in /etc/sysconfig/selinux to the following.

Disable SELinux Permanently

Disable SELinux Permanently

LEARN MORE  Arp-Scan Command Tutorial With Examples

1 Response

  1. 10/09/2019

    […] SELinux is a security mechanism to prevent intrusions into operating systems. It’s very powerful for security reasons but if you are using Fedora as desktop or if you do not have enough source and knowledge for SElinux try disabling it.  Keep in mind that disabling SELinux does not make us vulnerable to the attacks or make us a target for attackers. It is just an extra security layer for Linux. […]

Leave a Reply

Your email address will not be published. Required fields are marked *