红联Linux门户
Linux帮助

CentOS下彻底删掉SElinux的方法

发布时间:2014-11-30 15:49:23来源:linux网站作者:lqg1122

SELinux(Security-Enhanced Linux)安全增强式Linux,是一种强制访问控制(mandatory access control)的实现。这这种控制下,linux有很多的操作是会被禁止或者是不成功的。之前试过为php配置Oracle支持的时候怎样都弄不上去。后来把selinux干掉之后就完事了。好了,废话少说,下面说一下彻底干掉selinux的方法。


vim /etc/selinux/config 

打开selinux的配置文件,我们可以看selinux是默认开启的:

SELINUX=enforcing

所以我们要修改的就是这个了,把原来的注释掉,自己写上

SELINUX=disabled


具体如下:

# 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 - SELinux is fully disabled. 
#SELINUX=enforcing 
SELINUX=disabled 
# SELINUXTYPE= type of policy in use. Possible values are: 
#       targeted - Only targeted network daemons are protected. 
#       strict - Full SELinux protection. 
SELINUXTYPE=targeted


保存退出,然后重启一下就ok了。

其实我们可以在装完系统的时候马上做好这个处理,以后就不会因一时想不起来而在那纠结了。