centos disable selinux

0x00

centos 如何禁用 selinux?

0x01

  • 临时关闭:
1
2
3
4
5
6
[root@localhost ~]# getenforce
Enforcing

[root@localhost ~]# setenforce 0
[root@localhost ~]# getenforce
Permissive
  • 永久关闭:
1
2
[root@localhost ~]# vim /etc/sysconfig/selinux
SELINUX=enforcing 改为 SELINUX=disabled

设置后需要重启 reboot

Author: ronething
Link: https://blog.ronething.cn/20181203-selinux.html
Copyright Notice: All articles in this blog are licensed under CC BY-NC-SA 4.0 unless stating additionally.