CentOS7中怎么關(guān)閉selinux

CentOS7中怎么關(guān)閉selinux,針對這個問題,這篇文章詳細(xì)介紹了相對應(yīng)的分析和解答,希望可以幫助更多想解決這個問題的小伙伴找到更簡單易行的方法。

創(chuàng)新互聯(lián)來電聯(lián)系:028-86922220,為您提供成都網(wǎng)站建設(shè)網(wǎng)頁設(shè)計及定制高端網(wǎng)站建設(shè)服務(wù),創(chuàng)新互聯(lián)網(wǎng)頁制作領(lǐng)域10年,包括茶藝設(shè)計等多個方面擁有豐富的網(wǎng)站維護(hù)經(jīng)驗,選擇創(chuàng)新互聯(lián),為企業(yè)錦上添花!

在安裝Cobbler和Puppet時需要關(guān)閉selinux,但是通常情況下載安裝完CentOS7后,默認(rèn)情況下SElinux是啟用狀態(tài),

如下所示:

[csharp] view plaincopy

  1. [root@rdo ~]# sestatus  

  2. SELinux status:                 enabled  

  3. SELinuxfs mount:                /sys/fs/selinux  

  4. SELinux root directory:         /etc/selinux  

  5. Loaded policy name:             targeted  

  6. Current mode:                   enforcing  

  7. Mode from config file:          enforcing  

  8. Policy MLS status:              enabled  

  9. Policy deny_unknown status:     allowed  

  10. Max kernel policy version:      28  

1、如果要臨時關(guān)閉,可以執(zhí)行

[cpp] view plaincopy

  1. setenforce 0  

此時的狀態(tài)如下

[html] view plaincopy

  1. [root@rdo ~]# sestatus  

  2. SELinux status:                 enabled  

  3. SELinuxfs mount:                /sys/fs/selinux  

  4. SELinux root directory:         /etc/selinux  

  5. Loaded policy name:             targeted  

  6. Current mode:                   permissive  

  7. Mode from config file:          enforcing  

  8. Policy MLS status:              enabled  

  9. Policy deny_unknown status:     allowed  

  10. Max kernel policy version:      28  

2、如果要永久關(guān)閉,可以修改配置文件/etc/selinux/config,將SELINU置為disabled。

[html] view plaincopy

  1. [root@rdo ~]# cat /etc/selinux/config   

  2.   

  3. # This file controls the state of SELinux on the system.  

  4. # SELINUX= can take one of these three values:  

  5. #     enforcing - SELinux security policy is enforced.  

  6. #     permissive - SELinux prints warnings instead of enforcing.  

  7. #     disabled - No SELinux policy is loaded.  

  8. #SELINUX=enforcing  

  9. SELINUX=disabled  

  10. # SELINUXTYPE= can take one of three two values:  

  11. #     targeted - Targeted processes are protected,  

  12. #     minimum - Modification of targeted policy. Only selected processes are protected.   

  13. #     mls - Multi Level Security protection.  

  14. SELINUXTYPE=targeted   


修改該配置文件也可以執(zhí)行下面的命令來完成

[html] view plaincopy

  1. sed -i '/SELINUX/s/enforcing/disabled/' /etc/selinux/config  

修改完成后,保存重啟,重啟后狀態(tài)如下:

[html] view plaincopy

  1. [root@rdo ~]# sestatus  

  2. SELinux status:                 disabled  

  3.  

關(guān)于CentOS7中怎么關(guān)閉selinux問題的解答就分享到這里了,希望以上內(nèi)容可以對大家有一定的幫助,如果你還有很多疑惑沒有解開,可以關(guān)注創(chuàng)新互聯(lián)行業(yè)資訊頻道了解更多相關(guān)知識。

網(wǎng)頁標(biāo)題:CentOS7中怎么關(guān)閉selinux
本文地址:http://muchs.cn/article48/ghihep.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供外貿(mào)建站品牌網(wǎng)站制作、定制開發(fā)、網(wǎng)站制作、虛擬主機(jī)、搜索引擎優(yōu)化

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)

外貿(mào)網(wǎng)站制作