Skip to content

antony@notes:~/suse$ cat "Permanently-Disable-SELinux-on-SLE-Micro.md"

Permanently Disable SELinux on SLE Micro

2025-07-16· suse

Permanently Disable SELinux on SLE Micro

修改 SELinux 設定檔

$ vi /etc/selinux/config

檔案內容如下

# This file controls the state of SELinux on the system.
# SELinux can be completly disabled with the "selinux=0" kernel
# commandline option.
#
# SELINUX= can take one of these three values:
#     enforcing - SELinux security policy is enforced.
#     permissive - SELinux prints warnings instead of enforcing.
SELINUX=disabled
# SELINUXTYPE= can take one of these three values:
#     targeted - Targeted processes are protected,
#     minimum - Modification of targeted policy. Only selected processes are protected.
#     mls - Multi Level Security protection.
SELINUXTYPE=targeted
  • 將 SELINUX 的值修改為 disabled

永久修改

sed -i 's|SELINUX=enforcing|SELINUX=disabled|g' /etc/selinux/config
sed -i 's|selinux=1|selinux=0|g' /etc/default/grub
grub2-mkconfig -o /boot/grub2/grub.cfg

重新開機

$ reboot

設定開機選單

Step1: 在開機選單的 SLE Micro 5.4 按 e 編輯

image.png

Step2: 將 selinux=0 加到 linux 開頭那行的最後面

image.png

Step3: 按 Ctrl + x 繼續開機

image.png