selinux模块
selinux的模式有enforcing
、permissive
、disabled
三种。
enforcing:强制开启selinux
permissive:selinux运行中,会有告警信息,但实际不会限制
disabled:关闭,selinux没有运行
我们可以通过命令setenforce 0
来临时将selinux的状态设置为permissive
,但是系统重启后会重新读取文件/etc/selinux/config
中的配置。如果要永久关闭selinux,需要修改文件/etc/selinux/config
,把文件中的SELINUX=enforcing
修改为SELINUX=disabled
,然后重启系统。
如果selinux是disabled
的状态,那么通过命令setenforce 1
会报错。此时,只能通过修改文件/etc/selinux/config
为SELINUX=enforcing
,然后重启系统。然后,才能进行setenforce 0
或setenforce 1
的操作
Example
Reference
Last updated
Was this helpful?