Linux关闭selinux

时间:2026-02-16 19:15:26

1、查看是否开启SELinux,如果是未开启则是diabled,enforcing(enforce的分词,正在执行的意思),表明开启了

Linux关闭selinux

1、设置SELinux关闭 (setenforce 0或者setenforce permissive(中间状态),只是临时关闭,关机重启都会失效,SELinux关闭不彻底还是影响许多服务的正常运行)

Linux关闭selinux

1、vim 编辑配置文件 /etc/selinux/config

永久关闭、彻底关闭SELinux #开头的是注释

Linux关闭selinux

2、将SELINUX=enforcing修改为SELINUX=disabled

Linux关闭selinux

3、也可以通过sed命令修改配置文件,命令如下:

[root@cs1 ~]# sed -i 's#SELINUX=disabled#SELINUX=enforcing#g' /etc/selinux/config

Linux关闭selinux

4、查看配置文件是否修改成功:cat一下

cat /etc/selinux/config

Linux关闭selinux

5、重启系统,应用相关设置 reboot

Linux关闭selinux

6、检查SELinux是否成功关闭getenforce:

Linux关闭selinux

© 2026 一点资料
信息来自网络 所有数据仅供参考
有疑问请联系站长 site.kefu@gmail.com