永久关闭SELINUX

 

检查selinux状态

getenforce

 

禁用

sed -i 's@SELINUX=enforcing@SELINUX=disabled@g' /etc/selinux/config

setenforce 0

 

临时关闭(不用重启机器):

setenforce 0        设置SELinux 成为permissive模式

setenforce 1        设置SELinux 成为enforcing模式

 

 编辑 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

posted @ 2021-11-05 14:16  yuezenghui  阅读(314)  评论(0编辑  收藏  举报