OSWikiHK: 請協力 GPLv3 的中文翻譯工作。
開啟或關閉 SELinux
OSWikiHK,自由中文開源知識庫
[编辑]
CentOS/Fedora/RedHat 的 /etc/sysconfig/selinux
在新版本中的 Red Hat 和 Fedora 上,修改檔案 /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 - SELinux is fully disabled. SELINUX=enforcing # SELINUXTYPE= type of policy in use. Possible values are: # targeted - Only targeted network daemons are protected. # strict - Full SELinux protection. SELINUXTYPE=targeted
把 SELINUX 設定為 disable, 下次啟動系統後將會停止 SElinux。
[编辑]
Linux 核心參數(Kernel Parameter)
或者可以在核心參數後加上: selinux=0 (停止) 或 selinux=1 (開啟)參數
在 RHEL5 測 selinux=0 成功停止
在 RHEL5 測 selinux=1 開啟失敗(依然聽從 /etc/selinux/config 內 disabled 設定)
title Fedora Core (2.6.18-1.2798.fc6)
root (hd0,0)
kernel /vmlinuz-2.6.18-1.2798.fc6 ro root=LABEL=/ rhgb quiet selinux=0
initrd /initrd-2.6.18-1.2798.fc6.img
[编辑]
檢查 SELinux 現時況態
要知到您現在是否使用 SELinux:
# getenforce Enforcing

