Linux常用命令-setenforce

命令

setenforce

描述

modify the mode SELinux is running in
更改SELinux运行模式

用法

1
setenforce [Enforcing|Permissive|1|0]

选项

注意

示例

1
2
3
4
5
6
7
8
9
10
11
12
# Use Enforcing or 1 to put SELinux in enforcing mode.
# Use Permissive or 0 to put SELinux in permissive mode.

# 临时关闭SELinux
$ setenforce 0
# 永久关闭
$ sed -i 's/^SELINUX=.*$/SELINUX=disabled/' /etc/selinux/config
# 查看当前SELinux状态
$ getenforce
Disabled
$ sestatus
SELinux status: disabled