在安装Cobbler和Puppet时需要关闭selinux,但是通常情况下载安装完CentOS7后,默认情况下SElinux是启用状态,

如下所示:

[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、如果要临时关闭,可以执行

[cpp] view plaincopy

 
  1. setenforce 0

此时的状态如下

[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、如果要永久关闭,可以修改配置文件/etc/selinux/config,将SELINU置为disabled。

[html] view plaincopy

 
  1. [root@rdo ~]# cat /etc/selinux/config
  2. # This file controls the state of SELinux on the system.
  3. # SELINUX= can take one of these three values:
  4. #     enforcing - SELinux security policy is enforced.
  5. #     permissive - SELinux prints warnings instead of enforcing.
  6. #     disabled - No SELinux policy is loaded.
  7. #SELINUX=enforcing
  8. SELINUX=disabled
  9. # SELINUXTYPE= can take one of three two values:
  10. #     targeted - Targeted processes are protected,
  11. #     minimum - Modification of targeted policy. Only selected processes are protected.
  12. #     mls - Multi Level Security protection.
  13. SELINUXTYPE=targeted

修改该配置文件也可以执行下面的命令来完成

[html] view plaincopy

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

修改完成后,保存重启,重启后状态如下:

[html] view plaincopy

 
  1. [root@rdo ~]# sestatus
  2. SELinux status:                 disabled

http://www.centoscn.com/CentOS/config/2015/0618/5681.html

CentOS7中关闭selinux的更多相关文章

  1. 003 centos7中关闭防火墙

    在centos7中,防火墙有了新的变化.下面是常用的几个命令. 1.查看状态 systemctl status firewalld 2.关闭防火墙 systemctl stop firewalld.s ...

  2. 在gfs2中关闭selinux

    在构建iSCSI存储集群时,请勿在gfs2中使用selinux

  3. CentOS7中关闭firewall,并使用iptables管理防火墙

    背景描述 在使用Docker时,启用centos7默认的firewall,启动端口映射时,防火墙规则不生效.docker默认使用了iptables防火墙机制.所以需要关闭firewall使用iptab ...

  4. CentOS7/6 关闭防火墙

    CentOS6关闭防火墙使用以下命令, //临时关闭 service iptables stop //禁止开机启动 chkconfig iptables off CentOS7中若使用同样的命令会报错 ...

  5. Redhat Enterprise Linux中如何关闭SELinux?

    转自http://www.cnitblog.com/lywaml/archive/2005/06/21/468.html 红帽企业 Linux 4 包括了一个 SELinux 的实现.SELinux ...

  6. SELinux 了解及CentOS7 中 semanage命令的安装

    SELinux 安全子系统 SELinux(Security-Enhanced Linux)是美国国家安全局在Linux开源社区的帮助下开发的一个强制访问控制(MAC,Mandatory Access ...

  7. centos7 关闭SELINUX 防火墙

    关闭SELINUXvi /etc/selinux/config#SELINUX=enforcing #注释掉#SELINUXTYPE=targeted #注释掉SELINUX=disabled #增加 ...

  8. centos7 关闭selinux

    关闭SeLinux 临时关闭:setenforce 0 永久关闭:vi /etc/selinux/config

  9. centos7防火墙以设置以及关闭selinux

    一.CentOS 7.X 关闭SELinux 1.查看 getenforce permissive 或者 enforcing模式 2.临时设置 setenforce 1 成为permissive模式 ...

随机推荐

  1. volatile 和 Interlocked

    class Volatile_Test3 { ; public static void Test() { count = ; Task[] tasks = ]; ; i < tasks.Leng ...

  2. java客户端编辑为win中可执行文件(exe4j)

    exe4j 网址: http://www.ej-technologies.com/products/exe4j/overview.html

  3. 前端设计师必须知道的10个重要的CSS技巧

    对于一个初入门的前端设计师,在设计修改网站前端的时候,我们需要编写一些CSS.JS的内容达到界面效果.今天分享10个对于前端设计师来说重要的CSS技巧,这也是我在给许多客户做网站的过程当中总结出来的. ...

  4. 【分块答案】【最小割】bzoj1532 [POI2005]Kos-Dicing

    引用zky的题解:http://blog.csdn.net/iamzky/article/details/39667859 每条S-T路径代表一次比赛的结果.最小割会尽量让一个人赢得最多. 因为二分总 ...

  5. 【最短路】【spfa】小vijos P1447 Updown

    小vijos P1447 Updown 背景 开启了升降梯的动力之后,探险队员们进入了升降梯运行的那条竖直的隧道,映入眼帘的是一条直通塔顶的轨道.一辆停在轨道底部的电梯.和电梯内一杆控制电梯升降的巨大 ...

  6. python基础-文件处理与函数

    1. 文件处理 1.1 文件处理流程 1.打开文件,得到文件句柄并赋值给一个变量 2.通过句柄对文件进行操作 3.关闭文件 1.2 文件读取模式r r文本模式的读,在文件不存在,不会创建新文件 f = ...

  7. 1.1(Spring MVC学习笔记)初识SpringMVC及SpringMVC流程

    一.Spring MVC Spring MVC是Spring提供的一个实现了web MVC设计模式的轻量级Web框架. Spring优点:网上有,此处不复述. 二.第一个Spring MVC 2.1首 ...

  8. 线程协作-CountDownLatch

    CountDownLatch允许一个或多个线程等待其他线程完成操作.

  9. Sublime text JsFormat插件的安装

    javascript格式化插件JsFormat 1.下载这插件包 https://github.com/jdc0589/JsFormat 2.点击菜单:Preferences->Browse P ...

  10. t-sql 笔记(2)

    1.用标点符号分隔的字符串,转换成表 -- SELECT * FROM dbo.split('581:579:519:279:406:361:560',':') ), )) )) AS BEGIN D ...