关闭selinux

王朝学院·作者佚名  2016-05-26
窄屏简体版  字體: 小  |  中  |  大  |  超大  

关闭selinux1、查看SELinux状态:getenforce

Enforcing(启动)

disable(禁用)

1、禁用SELinux(重启后依然生效)

修改 vi /etc/sysconfig/selinux

[root@developer ~]#  vi  /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=enforcing

# SELINUXTYPE= can take one of these two values: #     targeted - Targeted processes are protected, #     mls - Multi Level Security protection. SELINUXTYPE=targeted

更改其中的SELINUX项的值就可以关闭和启用SELinux服务了。 修改成  SELINUX=disable     禁用SeLinux 修改成  SELINUX=enforcing   使用SeLinux 或      vi /etc/selinux/conf      set SELINUX=disabled

2、不重启让其生效

   /usr/sbin/setenforce 0 立刻关闭 SELINUX

    /usr/sbin/setenforce 1 立刻启用 SELINUX

3,加到系统默认启动里面

echo "/usr/sbin/setenforce 0" >> /etc/rc.local

echo "/usr/sbin/setenforce 0" >> /etc/rc.local

 
 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
 
© 2005- 王朝網路 版權所有 導航