# getenforce 获取 SELinux 状态 getenforce # 用于关闭 SELinux 防火墙,但重启后失效 setenforce 0 # 修改配置文件 # 将 SELINUX=enforcing 改为 SELINUX=disabled,保存后退出 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 - No SELinux policy is loaded. SELINUX=enforcing # 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