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
[root@rdo ~]# sestatus
SELinux status: enabled
SELinuxfs mount: /sys/fs/selinux
SELinux root directory: /etc/selinux
Loaded policy name: targeted
Current mode: enforcing
Mode from config file: enforcing
Policy MLS status: enabled
Policy deny_unknown status: allowed
Max kernel policy version: 28
1、如果要臨時關(guān)閉,可以執(zhí)行
[cpp] view plaincopy
setenforce 0
此時的狀態(tài)如下
[html] view plaincopy
[root@rdo ~]# sestatus
SELinux status: enabled
SELinuxfs mount: /sys/fs/selinux
SELinux root directory: /etc/selinux
Loaded policy name: targeted
Current mode: permissive
Mode from config file: enforcing
Policy MLS status: enabled
Policy deny_unknown status: allowed
Max kernel policy version: 28
2、如果要永久關(guān)閉,可以修改配置文件/etc/selinux/config,將SELINU置為disabled。
[html] view plaincopy
[root@rdo ~]# cat /etc/selinux/config
# 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 - No SELinux policy is loaded.
#SELINUX=enforcing
SELINUX=disabled
# SELINUXTYPE= can take one of three two values:
# targeted - Targeted processes are protected,
# minimum - Modification of targeted policy. Only selected processes are protected.
# mls - Multi Level Security protection.
SELINUXTYPE=targeted
修改該配置文件也可以執(zhí)行下面的命令來完成
[html] view plaincopy
sed -i '/SELINUX/s/enforcing/disabled/' /etc/selinux/config
修改完成后,保存重啟,重啟后狀態(tài)如下:
[html] view plaincopy
[root@rdo ~]# sestatus
SELinux status: disabled
關(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)