现在的位置: 首页 > 综合 > 正文

如何切换SELinux模式?

2013年06月04日 ⁄ 综合 ⁄ 共 732字 ⁄ 字号 评论关闭

SELinux默认运作在"Enforcing"模式。

$ sestatus -v
SELinux status:                 enabled
SELinuxfs mount:                /selinux
Current mode:                   enforcing
Mode from config file:          enforcing
Policy version:                 24
Policy from config file:        targeted

 

"Enforcing"模式下Zend Server CE运行会有问题,安装时需要切换到"Permissive"模式。

# setenforce permissive

 

但这需要每次开机后手动执行,我们可以通过修改SELinux配置实现自动切换。

# cat /etc/selinux/config 
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
#     enforcing - SELinux security policy is enforced.
#     permissive - SELinux prints warnings instead of enforcing.
#     disabled - No SELinux policy is loaded.
SELINUX=permissive
# SELINUXTYPE= can take one of these two values:
#     targeted - Targeted processes are protected,
#     mls - Multi Level Security protection.
SELINUXTYPE=targeted 

 

参考文档:Switch SELinux "Enforcing" mode to "Permissive" mode

抱歉!评论已关闭.