+4 votes
251 views
How to disable SELinux in CentOS 8

in Linux / Unix by (552k points)
reopened | 251 views

1 Answer

+5 votes
Best answer

1. Disable SELinux in CentOS 8
2. Disable SELinux completely in CentOS 8

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: image
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. image

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”: image
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 
image

It's that simple to disable SELinux in CentOS 8.


by (3.5m points)
edited

Related questions

+5 votes
1 answer
asked Nov 27, 2019 in Linux / Unix by backtothefuture (552k points) | 700 views
+5 votes
1 answer
asked Oct 27, 2019 in Linux / Unix by backtothefuture (552k points) | 838 views
+5 votes
1 answer
asked Oct 26, 2019 in Linux / Unix by backtothefuture (552k points) | 1.8k views
+3 votes
1 answer
asked Nov 16, 2019 in Linux / Unix by backtothefuture (552k points) | 655 views
+3 votes
1 answer
asked Nov 19, 2019 in Internet by backtothefuture (552k points) | 2.8k views
Sponsored articles cost $40 per post. You can contact us via Feedback

Most popular questions within the last 30 days

10,659 questions
10,791 answers
510 comments
3 users