今すぐに短期的に永久に無効にしたいのですが、何もうまくいかないようです
私が試した手順
[root@db1e secure]# setenforce 0
[root@db1e secure]# sestatus
SELinux status: enabled
SELinuxfs mount: /sys/fs/selinux
SELinux root directory: /etc/selinux
Loaded policy name: targeted
Current mode: permissive
Mode from config file: disabled
Policy MLS status: enabled
Policy deny_unknown status: allowed
Max kernel policy version: 28
/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 two values:
# targeted - Targeted processes are protected,
# minimum - Modification of targeted policy. Only selected processes are protected.
# mls - Multi Level Security protection.
SELINUXTYPE=targeted
その後、httpdサービスを再起動する
どちらも、予想どおり、無効ではなく有効という同じステータスになります。何かアイデアはありますか?
答え1
ファイルを編集した後/etc/sysconfig/selinux
、変更を有効にするには、リブートシステムで SELinux を完全に無効にするには、setenforce 0
再起動が行われるまでシステムを「許可」モードにする必要があります。
必ず変更してSELinux=enforcing
くださいSELinux=disabled