潇湘沐
通过配置文件调整SELinux的参数[root@www ~]# vi /etc/selinux/configSELINUX=enforcing <==调整 enforcing|disabled|permissiveSELINUXTYPE=targeted <==目前仅有 targeted 与 strictSELinux 的启动与关闭 【重要常识】:上面是预设的政策与启动的模式!要注意的是,如果改变了政策则需要重新开机;如果由 enforcing 或 permissive 改成 disabled ,或由 disabled 改成其他两个,那也必须要重新开机。这是因为 SELinux 是整合到核心里面去的, 只可以在 SELinux 运作下切换成为强制 (enforcing) 或宽容 (permissive) 模式,不能够直接关闭 SELinux 的!同时,由 SELinux 关闭 (disable) 的状态到开启的状态也需要重新开机。一、SELinux有三种运作模式:1、Enforcing:强制模式2、Permissive:宽容模式3、Disabled:关闭二、将 SELinux 在 Enforcing 与 permissive 之间切换与查看[root@www ~]# setenforce 0[root@www ~]# getenforce Permissive[root@www ~]# setenforce 1[root@www ~]# getenforce Enforcing