8月16日 開啟或關閉 SELinux

用LINUX 會決得榜手榜腳,但你也只是自己用,不是來假設伺服器,那麼就可以把selinux 關掉
開啟或關閉 SELinux
From OSWikiHK
Jump to: navigation, search

[編輯]
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

留言

這個網誌中的熱門文章

angular 如何Http 如何設定 CORS (Cross-Origin Resource Sharing)

Google Map 單車路徑計算坡度和角度小工具

Google URL Shortener API 快速教學