日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問(wèn) 生活随笔!

生活随笔

當(dāng)前位置: 首頁(yè) > 运维知识 > linux >内容正文

linux

CentOS7中关闭selinux

發(fā)布時(shí)間:2025/3/19 linux 32 豆豆
生活随笔 收集整理的這篇文章主要介紹了 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ò),歡迎將生活随笔推薦給好友。