SELinux 不會切換到「強制」模式

SELinux 不會切換到「強制」模式

我有一個最小的 CentOS 7.5.1804(核心)系統並嘗試從殘障人士執行但是當我嘗試使用命令更改模式時setenforce 1,我收到一條錯誤訊息:
setenforce: SELINUX is disabled

我變了/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 these three values:
#     targeted - Targeted processes are protected,
#     minimum - Modification of targeted policy. Only selected processes are pr$
#     mls - Multi Level Security protection.
SELINUXTYPE=targeted

我重新啟動了系統幾次,但 SELinux 仍然被停用。

我現在應該去哪裡檢查?上面還有其他機制嗎/etc/selinux/config可以操縱 SELinux 狀態的檔案?

註1:我沒有直接在機器上安裝和設定 CentOS 7。因此,安裝後可能已經完成了某些自訂。系統目前有以下三個SELinux策略套件:

selinux-policy-minimum
selinux-policy-mls
selinux-policy-targeted

筆記2: 這個問題與SELINUX 不會啟用我知道它已經關閉了無關旗幟。但它關閉是因為使用者在 linode 上使用 linode 提供的(自訂)內核,但不支援 SELinux(正如史蒂芬哈里斯在評論中所說)

答案1

我做了一些研究考慮評論亞歷山大AB。我實施的解決方案步驟如下:

  1. /etc/grub.d/目錄中,一個名為的檔案40_custom包含一個表達式selinux=0(順便說一句,我在grub 引導程式選單)。我把它改為selinux=1.
  2. 執行命令grub2-mkconfig -0 /boot/grub2/grub.cfg。執行成功結束。
  3. 我再次檢查/etc/selinux/config文件是否有SELINUX=enforcing表達式。

重新啟動後,SELinuxgetenforce指令顯示Enforcing

相關內容