How to Disable SELinux Permanently in Linux server?

In this tutorial, we will describe the procedure to disable SELinux permanently in Linux server. Let us go through the procedure in detail.

How to Disable SELinux
  • Login to SSH with root credentials and follow the below mentioned steps.

#1. Check the Status SELinux on your system

To check the status of SELinux, execute the following command.

sestatus

#2. Edit selinux file to disable SELinux

Follow the commands below to do the same.

  • Get into editor mode with the below given command.
 vi /etc/sysconfig/selinux
  • Now, press i to get into Insert mode and edit the line as directed.

    Edit SELinux File
  • Change SELinux=enabled to disabled. Click ESc to exit Insert mode.
  • Then, use the command :wq! to save the changes and exit.

Now, reboot the system and then check status of SELinux using SELinux command.

That’s It !

Hope the article better describes the procedure to disable SELinux permanently. Do share it with your colleagues if you find it working. Also share your suggestions and drop your queries to start the discussion on the related topic. Lets connect on social media with the below links.

Facebook Page: https://facebook.com/redserverhost                                                                                       Twitter Page: https://twitter.com/redserverhost.com

Scroll to Top