要关掉selinux只需要将配置文件中的selinux=enable改成disable

[root@host]# 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 - SELinux is fully disabled.
SELINUX=disabled#把这里改成disable
# SELINUXTYPE= type of policy in use. Possible values are:
# targeted - Only targeted network daemons are protected.
# strict - Full SELinux protection.
SELINUXTYPE=targeted
------------------------------------------------------------------------------------- 

修改后重启系统即可。

如果在想不重启系统的情况下关掉SELINUX,可以输入命令:

setenforce 0