How to view and close SELinux in Linux system
This article mainly explains "how to view and close SELinux in Linux system". Interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Let Xiaobian take you to learn "How to view and close SELinux in Linux system"!
1. Check SELinux status command:
1./usr/sbin/sestatus -v ##If SELinux status parameter is enabled, it is enabled
SELinux status: enabled
2. getenforce ##can also be checked with this command
Second, close SELinux method:
1. Temporary shutdown (without restarting the machine):
The code is as follows:
setenforce 0 #Set SELinux to permissive mode
#setenforce 1 Set SELinux to enforcement mode
2. Modifying the configuration file requires restarting the machine:
Modify the/etc/selinux/config file
For SELINUX=enforcing read SELINUX=disabled
Restart the machine
At this point, I believe that everyone has a deeper understanding of "how to view and close SELinux in Linux system," so let's actually operate it! Here is the website, more related content can enter the relevant channels for inquiry, pay attention to us, continue to learn!