在安装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. Codeforces 361D Levko and Array(二分)(DP)

    Levko and Array time limit per test 2 seconds memory limit per test 256 megabytes input standard inp ...

  2. centos 7 下发送邮件设置

    使用sendmail发邮件的配置 yum -y install sendmailservice sendmail start vim body.txttest mail from linux. mai ...

  3. Servlet规范简介

    引言 Web 框架一般是通过一个 Servlet 提供统一的请求入口,将指定的资源映射到这个 servlet, 在这个 servlet 中进行框架的初始化配置,访问 Web 页面中的数据,进行逻辑处理 ...

  4. 【kmp算法】uva11475 Extend to Palindrome

    就把每个串倒过来,和原串匹配,看最后能匹配多少就行. #include<cstring> #include<algorithm> #include<cstdio> ...

  5. 1.2(学习笔记) JSP动作元素

    动作元素 jsp:useBean:根据指定类实例化一个对象,类似Preson per = new Preson(); <jsp:useBean id="对象名" class ...

  6. SQL server 2008 安装问题解决 转

    http://www.cnblogs.com/Hackerman/p/4472811.html   安装sqlserver2008 出现的一些问题解决方法 1,安装sqlserver的时候出现如下图所 ...

  7. How to enable Hibernate option in windows 2008 R2 server?

    http://velshare.blogspot.com/2013/02/how-to-enable-hibernate-option-in.html 1) To enable the Hiberna ...

  8. 《你不知道的 CSS》之等比例缩放的盒子

    你肯定已经知道,对于一个 img 元素而言,你可以单独地修改它的 width 或者 height 属性来设置它的大小,同时图片的比例还能够保持不变. 如下图所示,最上面是原始大小的图片,下面两张则分别 ...

  9. IOS开发使用委托delegate在不同窗口之间传递数据

    IOS开发使用委托delegate在不同窗口之间传递数据是本文要介绍的内容,主要是来讲解如何使用委托delegate在不同窗口之间传递数据,具体内容来看详细内容.在IOS开发里两个UIView窗口之间 ...

  10. python获取当前文件路径

    python获取当前文件路径 学习了:https://www.cnblogs.com/strongYaYa/p/7200357.html https://blog.csdn.net/heatdeath ...