引用: http://wiki.linux.org.hk/w/Enable_or_Disable_SELinux

 

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 設定)

檔案 /boot/grub/menu.lst

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
創作者介紹
創作者 evanswa29 筆記 的頭像
evans

evanswa29 筆記

evans 發表在 痞客邦 留言(0) 人氣( 367 )