• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

SMASHING LAB

GUIDES | LINUX | GEEKY STUFF

  • Nginx
  • Linux
  • Guide
  • Ubuntu
  • WordPress
  • Drones, My Hobby

Guide on How to Disable SELinux

By Imran Yousaf

SELinux is an access control program that is installed and activated by default on Linux distributions such as RHEL (Red Hat Enterprise Linux), CentOS, and Fedora.

If you installed a new system or installed a new application and it did not work, then you need to test SELinux, as it is likely that it could be the cause of this problem.

From this article, you will learn how to check the current status of SELinux, how to disable or enable SELinux temporarily or permanently.

Check SELinux Status

Run the following command to see if SELinux is running :

1
# getenforce

getenforceinforms in what standing is SELinux: Enforcing (on), Permissive (included in notification mode), or Disabled (disabled).

Temporarily Disable SELinux

The following changes are temporary and will be lost after the reboot.

Temporarily Disable SELinux

Use the following command to temporarily disable SElinux.

1
# setenforce 0

Temporarily Enable SELinux

Use the following command to temporarily enable SElinux.

1
# setenforce 1

Permanently Disable SELinux

Open the file to edit /etc/selinux/config.

1
2
3
4
5
6
7
8
9
10
11
$ cat /etc/selinux/config
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
#     enforcing - SELinux security policy is enforced.
#     permissive - SELinux prints warnings instead of enforcing.
#     disabled - No SELinux policy is loaded.
<strong>SELINUX=disabled</strong>
# SELINUXTYPE= can take one of these two values:
#     targeted - Targeted processes are protected,
#     mls - Multi Level Security protection.
SELINUXTYPE=targeted

Permanently Disable SELinux

Edit strobe SELINUX = in a file /etc/selinux/configof:

1
SELINUX=disabled

Permanently Enable SELinux

Edit strobe SELINUX = in a file /etc/selinux/configof:

1
SELINUX=enforcing

Some more articles you might also be interested in …

  • How to Disable Iptables Firewall in CentOS
  • How to Become a Hacker: Basic Guide for Beginners
  • Guide How to Install Apache in Ubuntu 18.04
  • Complete Guide: How To Install Ubuntu Server 18.04
  • How To Dual Boot Linux/Ubuntu and Windows 10…
  • Install LEMP Stack (Nginx, MariaDB, PHP-FPM) on…
Tweet
Pin
Share1
1 Shares

Filed Under: Guide

Primary Sidebar

  • Twitter
  • Facebook
  • Google+

Recent Posts

  • How to install Nextcloud on CentOS 8
  • How to install Zabbix on openSUSE Leap 15.1
  • How to Easily Configure Your Domain’s Email Account with Gmail?
  • Tails 4.4 OS Released with Tor Browser 9.0.6
  • How to Convert JPG to PDF in Linux

Subscribe to our Newsletter

Useful articles, tips and videos about creating and promoting websites to your mail



* required field


  • Contact Us
  • Privacy Policy
  • About Us

Copyright © 2021. Smashing Lab