生活随笔
收集整理的這篇文章主要介紹了
CentOS7中关闭selinux
小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
2019獨(dú)角獸企業(yè)重金招聘Python工程師標(biāo)準(zhǔn)>>>
在安裝Cobbler和Puppet時(shí)需要關(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、如果要臨時(shí)關(guān)閉,可以執(zhí)行
[cpp]?view plaincopy
?
setenforce?0??此時(shí)的狀態(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í)行下面的命令來(lái)完成
[html]?view plaincopy
?
sed?-i?'/SELINUX/s/enforcing/disabled/'?/etc/selinux/config ?修改完成后,保存重啟,重啟后狀態(tài)如下:
[html]?view plaincopy
?
[root@rdo?~]#?sestatus??SELinux?status:?????????????????disabled???
轉(zhuǎn)載于:https://my.oschina.net/u/3346994/blog/1501341
總結(jié)
以上是生活随笔為你收集整理的CentOS7中关闭selinux的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
如果覺(jué)得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。