Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How linux shuts down selinux

2025-03-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)05/31 Report--

Editor to share with you how linux shut down selinux, I believe that most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!

Methods: 1, use the "vim / etc/sysconfig/selinux" command to open the selinux file; 2, modify the "SELINUX=enforcing" in the file to "SELINUX=disabled"; 3, modify and save, restart.

The operating environment of this tutorial: linux7.3 system, Dell G3 computer.

The easiest and quickest way is to close SELinux through the command line interface, because there is basically no graphical interface open on the server. First of all, let's take a look at the status of SELinux by getenforce, which is generally Enforcing by default, which means to force it. As shown in the following figure:

SELinux has a total of three states, which are Enforcing,Permissive and Disabled. The first is the default state, which means mandatory, and the second is tolerance, that is, most of the rules are released. The third is disabled, that is, no rules are set. The first two states can only be set through the setenforce command, and if you want to change to the disable state, you need to modify the configuration file and restart the system at the same time. Let's first look at the modification. The value of the Enforcing state is 1. The permissive state is 0, so set to permissive. The command is as follows:

Setenforce 0

Then check the current status:

Getenforce

As shown in the following figure:

However, the above modification will be invalid after restart, only temporarily effective. Let's take a look at the state after rebooting the computer. Execute the command:

Reboot

Restart the computer, and then use the command:

Getenforce

Looking at the status, you can see that it has indeed changed to the Enforcing status again:

So we need to make a configuration permanent by modifying the settings file. The location of the configuration file is:

/ etc/selinux/config

As shown in the following figure, when we open this file, we can see that its default state is enforcing state.

We can change the value behind it to permissive or disabled, so that even after the computer is rebooted, its default state will be permissve or disabled, rather than returning to enforcing. The status after restart is shown in the third figure below:

The above is all the content of the article "how linux shuts down selinux". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report