centos6 查看SELinux狀態 關閉SELinux

來源:互聯網
上載者:User

centos6 查看SELinux狀態 關閉SELinux
SELinux(Security-Enhanced Linux) 是美國國家安全域(NSA)對於強制存取控制的實現,是 Linux曆史上最傑出的新安全子系統。在這種存取控制體系的限制下,進程只能訪問那些在他的任務中所需要檔案。SELinux 預設安裝在 Fedora 和 Red Hat Enterprise Linux 上。

雖然SELinux很好用,但是在多數情況我們還是將其關閉,因為在不瞭解其機制的情況下使用SELinux會導致軟體安裝或者應用部署失敗

以下就是關閉SELinux的方法


系統版本:centos 6.5 mini


1、查看selinux狀態
查看selinux的詳細狀態,如果為enable則表示為開啟
# /usr/sbin/sestatus -v


查看selinux的模式
# getenforce


2、關閉selinux
2.1:永久性關閉(這樣需要重啟伺服器後生效)
# sed -i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config


2.2:臨時性關閉(立即生效,但是重啟伺服器後失效)
# setenforce 0 #設定selinux為permissive模式(即關閉)
# setenforce 1 #設定selinux為enforcing模式(即開啟)


這樣就關閉SELinux了,當安裝軟體遇到問題時可以考慮關閉SELinux再進行安裝

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.