We have heard a lot about security in Linux and it is not for less that we always talk about it since a system that is not based on certain security policies. This can create numerous risks ranging from information theft to general system failures bringing irreversible consequences. Therefore, Linux has developed Security-Enhanced Linux (SELinux) which is basically a security architecture for Linux systems allowing administrators to have centralized control over which users have access to the system or not, something ideal for privacy issues and availability of equipment information. SELinux was released in 2000 and its integration to the Linux kernel was in 2003..
The SELinux policy rules allow you to identify the way you can see the Linux processes and the users that work on the computer , this allows that at the moment there is no rule associated with a certain access permission to an object, this access simply It will be denied which may affect other types of operations at a general level of the system.
SELinux modes
SELinux has three modes of operation that are:
- Enforcing: this allows access based on SELinux's integrated policy rules.
- Permissive: with this mode only the actions to be denied will be registered if the mandatory mode is used.
- Disabled: as the name implies, it does not load any SELinux policy.
By default, CentOS 8 will have SELinux enabled and in mandatory mode (Enforcing) which may affect certain administrative tasks, so TechnoWikis will explain how to deactivate SELinux in CentOS 8 in a functional way..
1. Disable SELinux in CentOS 8
Step 1
The first thing to do will be to know the status of SELinux, for this we execute the following command:
Sestatus
Step 2
As a result we will see full details of SELinux as follows:
Step 3
We can see that its state is enabled (enabled), in this state it can be in mandatory or permissive mode, we can switch between modes with the following command if we wish:
sudo setenforce 0
Step 4
If we want SELinux to always be permissive, we will edit the following file:
sudo nano / etc / selinux / config
Step 5
There we change the value "enforcing" to "permissive" in the SELINUX line. We save the changes and restart session to complete the process.
2. Disable SELinux completely in CentOS 8
Step 1
If the plan is to completely disable SELinux we access the file again:
sudo nano / etc / selinux / config
Step 2
In the SELINUX line we set the value “disabledâ€:
Step 3
We save the changes using the following key combination:
+ O Ctrl + O
We leave the editor using:
+ X Ctrl + X
Step 4
We restart CentOS 8 and we can validate the status of SELinux again:
sestatus
It's that simple to disable SELinux in CentOS 8.