1 查看selinux状态
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=enforcing
# SELINUXTYPE= can take one of three values:
# targeted - Targeted processes are protected,
# minimum - Modification of targeted policy. Only selected processes are protected.
# mls - Multi Level Security protection.
SELINUXTYPE=targeted
2. 关闭
sed -i 's#SELINUX=enforcing#SELINUX=disabled#g' /etc/selinux/config
修改完之后,必须重启才能生效
3 临时生效
setenforce 0