Connect with us

Hi, what are you looking for?

Linux

How to Configure SELinux Modes on CentOS 8 / RHEL 8

In this tutorial we will configure SELinux Modes on CentOS 8 / RHEL 8. SELinux stands for Security-Enhanced Linux and it is developed by the NSA National Security Agency. The SELinux is the additional security module referred to the Enterprise Linux. SELinux policy must be enabled to CentOS / RHEL to enable security policies belongs to Linux.

SELinux can be run in 3 modes :

  1. Enforcing
  2. Permissive
  3. Disabled

Step-1 : Check the status of SELinux

This command shows you the brief details about SELinux and it can be useful for checking the SELinux status.

[root@techbrown ~]# sestatus

Step-2 : Check the status of Enforcing mode

This command shows whether is enforce is working or not

[root@techbrown ~]# getenforce

If output its is shows Permissive means SELinux is running Permissive mode

Advertisement. Scroll to continue reading.

If output its is shows Enforcing means SELinux is running Enforcing mode

If output its is shows Disabled means SELinux is in Disabled mode

Step-3 : Temporary Enable the Enforcing mode and permissive mode

Temporary Enable the Enforcing mode

[root@techbrown ~]# setenforce 1

Temporary Enable the Permissive mode

Advertisement. Scroll to continue reading.
[root@techbrown ~]# setenforce 0

Step-4 : Permanently Enable the Enforcing mode and permissive mode

Permanently Enable the Enforcing mode

[root@techbrown ~]# vi /etc/sysconfig/selinux

Find the line and edit with the given one

SELINUX = enforcing

When completes save and exit from the editor :wq

Permanently Enable the Permissive mode

Advertisement. Scroll to continue reading.
[root@techbrown ~]# vi /etc/sysconfig/selinux

Find the line and edit with the given one

SELINUX = permissive 

When completes save and exit from the editor :wq

Step-5 : Restart the PC to make changes in effect

When done now you are ready to restart your Linux machine to make the changes in effect.

[root@techbrown ~]# systemctl reboot

Conclusion: Finally you have configured various modes of SELinux policy. Now you have secured your CentOS and RHEL Linux distribution at a next level of security. If you have any doubts or some questions in your mind feel free  to use the comment section below.

Advertisement. Scroll to continue reading.
Comments
Advertisement
Advertisement
Advertisement

You May Also Like

Windows

How to auto upgrade JioFi firmware for JioFi 2 / JioFi 3 / JioFi 4 / JioFi 5 / JioFi 6 and other JioFi...

Windows

Internet is the most important public network for connecting to the WEB. For internet connection requirement the ISP is required as well as it...

Windows

How to download and install the Mobile Intel 4 Series Express Chipset Graphics Drivers for Windows 10.  Windows 10 is the one of the...

Windows

How to Install and Configure PCSX2 on Windows 10. The Windows 10 is the most recommended operating system for the Games. In stream platform...