我有一些系统,出于各种原因,我们希望完全禁用selinux。到目前为止,这就像一个champ,总是在启动时使用selinux=0,并确保/etc/sysconfig/selinux包含:
SELINUX=disabled但是,到今天为止,我有一个Fedora 17工作站已经正确设置,但是在许多重新启动之后,它总是以强制模式出现:
# cat /etc/sysconfig/selinux
# 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 these two values:
# targeted - Targeted processes are protected,
# minimum - Modification of targeted policy. Only selected processes are protected.
# mls - Multi Level Security protection.
SELINUXTYPE=targeted
# getenforce
Enforcing是什么导致selinux忽略sysconfig条目,还是不顾sysconfig条目而启动?
编辑1
我在这里看到了一个相关的问题,我试了一下:
# selinuxenabled ; echo $?
0
# getenforce
Enforcing发布于 2013-04-25 19:23:14
实际的配置文件是/etc/sellinux/config,其中/etc/sysconfig/selinux链接。看起来您可能丢失了链接,并最终得到了一个常规文件。
核实:
# ls -l /etc/sysconfig/selinux
lrwxrwxrwx. 1 root root 17 Dec 22 18:59 /etc/sysconfig/selinux -> ../selinux/config或检查/etc/selinux/config的内容
发布于 2022-04-28 02:43:14
运行CentOS 8时,我将其用于脚本:
sed -i "s/SELINUX=.*/SELINUX=disabled/" /etc/selinux/config基本上,您希望SELinux配置文件具有以下设置
\x{e76f} /etc/selinux/config:
...if...
SELINUX=enabled...change到..。
SELINUX=disabled虽然sudo setenforce 0将临时将其设置为“允许的”,但更改配置文件将永久地将其设置为“禁用”。
https://serverfault.com/questions/500957
复制相似问题