CentOS 7 关闭 SELinux
2019-04-26 本文已影响0人
changhr2013
查看 SELinux 开关状态
- 使用
sestatus -v
命令
# 如果 SELinux status 参数为 enabled 即为开启状态
sestatus -v

- 使用
getenforce
命令
# 如果结果是 Enforcing 即为开启状态
getenforce

开启或关闭 SELinux
- 临时关闭,不需要重启
# 设置 SELinux 为 permissive 模式
setenforce 0
# 设置 SELinux 为 enforcing 模式
setenforce 1
- 修改配置文件,需要重启
修改/etc/selinux/config
文件
将SELINUX=enforcing
修改为SELINUX=disabled
。
重启机器即可。