SELinux全称是Security Enhanced Linux,由美国国家安全部(National Security Agency)领导开发的GPL项目,它拥有一个灵活而强制性的访问控制结构,旨在提高Linux系统的安全性,提供强健的安全保证,可防御未知攻击,据称相当于B1级的军事安全性能。比MS NT所谓的C2等高得多。

应用SELinux后,可以减轻恶意攻击或恶意软件带来的灾难,并提供对机密性和完整性有很高要求的信息很高的安全保障。 SELinux vs Linux 普通Linux安全和传统Unix系统一样,基于自主存取控制方法,即DAC,只要符合规定的权限,如规定的所有者和文件属性等,就可存取资源。在传统的安全机制下,一些通过setuid/setgid的程序就产生了严重安全隐患,甚至一些错误的配置就可引发巨大的漏洞,被轻易攻击。

因为SELinux的安全性,使得很多应用在一些默认设置下,由于SELinux的设置而造成一些额外的问题.所以本文就是讨论如何关闭SELinux.
测试系统文CentOS 6.x
在系统运行状态执行如下命令关闭SELinux的作用


setenforce 0

setenforce                   0



编辑/etc/sysconfig/selinux如下:




# 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=enforcing SELINUX=disabled # SELINUXTYPE= can take one of these two values: # targeted - Targeted processes are protected, # mls - Multi Level Security protection. SELINUXTYPE=targeted

# 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=enforcing


SELINUX = disabled


# SELINUXTYPE= can take one of these two values:


# targeted - Targeted processes are protected,


# mls - Multi Level Security protection.


SELINUXTYPE = targeted



系统重启后也生效.