How to check SELinux status and turn off SELinux under Linux
This article introduces the knowledge of "how to check SELinux status and turn off SELinux under Linux". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!
1. View the SELinux status command:
1. / usr/sbin/sestatus-v # # if SELinux status parameter is enabled, it is enabled.
SELinux status: enabled
2. Getenforce # # can also use this command to check
2. Disable the SELinux method:
1. Temporarily shut down (no need to restart the machine):
The code is as follows:
Setenforce 0 # sets SELinux to permissive mode
# setenforce 1 sets SELinux to enforcing mode
2. To modify the configuration file, you need to restart the machine:
Modify / etc/selinux/config file
Change SELINUX=enforcing to SELINUX=disabled
Just restart the machine.
This is the end of the content of "how to check SELinux status and turn off SELinux under Linux". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!