0

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

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

[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

[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

That’s all for now.

How to Create Offline DNF Repository on RHEL / CentOS

Previous article

How to Configure ISCSI Target Server on CentOS / RHEL

Next article

You may also like

Comments

Leave a reply

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

More in Linux