CentOS下彻底删掉SElinux的方法


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

vim /etc/selinux/config  

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

  1. SELINUX=enforcing  

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

  1. SELINUX=disabled  

具体如下:

  1. # This file controls the state of SELinux on the system.  
  2. # SELINUX= can take one of these three values:  
  3. #       enforcing - SELinux security policy is enforced.  
  4. #       permissive - SELinux prints warnings instead of enforcing.  
  5. #       disabled - SELinux is fully disabled.  
  6. #SELINUX=enforcing  
  7.  SELINUX=disabled  
  8. # SELINUXTYPE= type of policy in use. Possible values are:  
  9. #       targeted - Only targeted network daemons are protected.  
  10. #       strict - Full SELinux protection.  
  11. SELINUXTYPE=targeted  

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

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

相关内容