1. Home
  2. How To
  3. Dedicated Server
  4. How to Disable SELinux on RPM-based Distributions

How to Disable SELinux on RPM-based Distributions

Objectives

A quick guide on how to disable Security-Enhanced Linux (SELinux) in any RPM-based distributions (CentOS, RedHat, RHEL and etc).

Prerequisites

  1. A virtual machine with any RPM-based distro installed.

Steps

Step 1: Check Current Status

To check the current status of SELinux, simply enter the following command: –

sestatus

Sample Output: –

Step 2: Edit Config file to Disable SELinux

Next, you can use the nano text editor to modify the /etc/selinux/config file.

nano /etc/selinux/config

Change the value from enforcing to disabled.

Save and exit the editor.

Alternatively, if you wish to disable / enable SELinux temporarily, you can use setenforce command.

setenforce Enforcing / Permissive / Disabled

Step 3: Verify Your Changes

Reboot the server and check the status of SELinux to see if it is disabled.

sestatus OR getenforce

Updated on July 17, 2020

Was this article helpful?

Related Articles

Need Help?
Submit a ticket to us and let our professional team assists you

Support Billing Sales
Support
Billing
Sales