美文网首页
CentOS 7 关闭 SELinux

CentOS 7 关闭 SELinux

作者: changhr2013 | 来源:发表于2019-04-26 10:45 被阅读0次

查看 SELinux 开关状态

  1. 使用 sestatus -v 命令
# 如果 SELinux status 参数为 enabled 即为开启状态
sestatus -v
sestatus -v
  1. 使用 getenforce 命令
# 如果结果是 Enforcing 即为开启状态
getenforce
getenforce

开启或关闭 SELinux

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

相关文章

网友评论

      本文标题:CentOS 7 关闭 SELinux

      本文链接:https://www.haomeiwen.com/subject/ehtfnqtx.html