無法在 RHEL 7 中停用 SELinux

無法在 RHEL 7 中停用 SELinux

我正在嘗試在 aws ec2 實例上安裝的 rhel7 env 中停用 SELinux。我編輯了/etc/selinux/config文件並設置SELINUX=disabled,然後重新啟動了系統。重新啟動後,我運行sestatus命令並發現它保持啟用狀態:

SELinux status:                 enabled
SELinuxfs mount:                /sys/fs/selinux
SELinux root directory:         /etc/selinux
Loaded policy name:             targeted
Current mode:                   enforcing
Mode from config file:          enforcing
Policy MLS status:              enabled
Policy deny_unknown status:     allowed
Max kernel policy version:      28

知道為什麼它沒有改變嗎?

答案1

發現了問題。該/etc/selinux/config文件在定義之前有 SELINUX=enforcing ,SELINUX=disabled這阻止了禁用 selinux 所以我評論了SELINUX=enforcing並且它起作用了

相關內容