INEWUP'S BLOG

RHEL一条命令更改SELINUX

` 查看selinux运行状态

selinuxenabled && echo enabled || echo disabled

临时生效 `

setenforce 0 关闭selinux并且立即生效,并且是永久生效

setenforce 0 sed -i 's/SELINUX=.*/SELINUX=disabled/' /etc/selinux/config

3个状态说明

This file controls the state of SELinux on the system.

SELINUX=disabled

enforcing - SELinux security policy is enforced.

permissive - SELinux prints warnings instead of enforcing.

disabled - No SELinux policy is loaded.