首页 > Linux操作系统 > Linux操作系统 > Linux关闭selinux
Linux关闭selinux有临时关闭和永久关闭两种;
临时关闭情况下,下一次重启Linux系统,selinux会自动启动
[root@node1 ~]# getenforce -- 查看selinux状态 enforcing [root@node1 ~]# setenforce 0 -- 临时关闭selinux [root@node1 ~]# getenforce -- 查看selinux关闭后与关闭前的状态 permissive
当一个Linux服务器想永久关闭selinux,但又不想重启服务器,可以先按照临时关闭的方式执行语句关闭selinux;然后修改selinux配置文件的SELINUX的值为disabled;
[root@node1 ~]# vi /etc/sysconfig/selinux -- 修改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=disabled # SELINUXTYPE= can take one of three two values: # targeted - Targeted processes are protected, # minimum - Modification of targeted policy. Only selected processes are protected. # mls - Multi Level Security protection. SELINUXTYPE=targeted
修改配置文件后,重启Linux系统后,查看状态会变成disabled;
[root@node1 ~]# reboot [root@node1 ~]# getenforce -- 重启后查看selinux状态 Disabled
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/69985104/viewspace-2728107/ ,如需转载,请注明出处,否则将追究法律责任。