Docs/linux基础/修改selinux.md

4.2 KiB
Raw Blame History

<html> <head>

</head>
<div class="note-container">
	<h1 class="title" id="leanote-title">修改selinux</h1>
	<div class="content-html" id="leanote-content"><p>查看SELinux状态</p><p>1、/usr/sbin/sestatus -v &nbsp; &nbsp; &nbsp;##如果SELinux status参数为enabled即为开启状态</p><p>SELinux status: &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; enabled</p><p>2、getenforce &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ##也可以用这个命令检查</p><p>关闭SELinux</p><p>1、临时关闭不用重启机器</p><p>setenforce 0 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;##设置SELinux 成为permissive模式</p><p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ##setenforce 1 设置SELinux 成为enforcing模式</p><p>2、修改配置文件需要重启机器</p><p>修改/etc/selinux/config 文件</p><p>将SELINUX=enforcing改为SELINUX=disabled</p><p>重启机器即可</p></div>
</div>
</html>