From f4346c9835687523c835ab471f39413fb64816d9 Mon Sep 17 00:00:00 2001 From: iProbe Date: Wed, 1 Feb 2023 10:52:25 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20'linux=E5=9F=BA=E7=A1=80/?= =?UTF-8?q?=E4=BF=AE=E6=94=B9selinux.md'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- linux基础/修改selinux.md | 184 ++++----------------------------------- 1 file changed, 19 insertions(+), 165 deletions(-) diff --git a/linux基础/修改selinux.md b/linux基础/修改selinux.md index c9880fc..40b9ea1 100644 --- a/linux基础/修改selinux.md +++ b/linux基础/修改selinux.md @@ -1,165 +1,19 @@ - - - - - -修改selinux - - - - - - - -
-

修改selinux

-

查看SELinux状态:

1、/usr/sbin/sestatus -v      ##如果SELinux status参数为enabled即为开启状态

SELinux status:                 enabled

2、getenforce                 ##也可以用这个命令检查

关闭SELinux:

1、临时关闭(不用重启机器):

setenforce 0                  ##设置SELinux 成为permissive模式

                              ##setenforce 1 设置SELinux 成为enforcing模式

2、修改配置文件需要重启机器:

修改/etc/selinux/config 文件

将SELINUX=enforcing改为SELINUX=disabled

重启机器即可

-
- - - - - \ No newline at end of file +# 查看SELinux状态: +1、如果SELinux status参数为enabled即为开启状态 +```shell +/usr/sbin/sestatus -v +``` +SELinux status: enabled +2、可以用这个命令检查 +```shell +getenforce +``` +# 关闭SELinux +1、临时关闭(不用重启机器) +```shell +##设置SELinux 成为permissive模式 +setenforce 0 +``` +setenforce 1 设置SELinux 成为enforcing模式 +2、修改配置文件需要重启机器 +修改/etc/selinux/config 文件,将SELINUX=enforcing改为SELINUX=disabled

重启机器即可 \ No newline at end of file