临时关闭 (机器重启后失效)
setenforce 0
永久关闭 (机器重启后依然生效)
执行以下语句, 去修改配置文件:
vim /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 values:
# targeted - Targeted processes are protected,
# minimum - Modification of targeted policy. Only selected processes are protected.
# mls - Multi Level Security protection.
SELINUXTYPE=targeted
保存配置文件, 重启机器, 命令为:
shutdown -r now
重启机器后, 执行以下命令, 检查SELinux的状态:
getenforce
显示为disabled即为设置生效
disabled