第一種修改配置文件,永久生效:
[root@VM_0_7_centos ~]# cat /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=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
[root@VM_0_7_centos ~]#
第二種臨時關閉,setenforce 0相當於disabled,1 相當於enforcing。
[root@VM_0_7_centos ~]# setenforce 0
[root@VM_0_7_centos ~]# getenforce
Disabled