在安装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. 主席树【bzoj3524(p3567)】[POI2014]Couriers

    Description 给一个长度为n的序列a.1≤a[i]≤n. m组询问,每次询问一个区间[l,r],是否存在一个数在[l,r]中出现的次数大于(r-l+1)/2.如果存在,输出这个数,否则输出0 ...

  2. Exchange2010启用反垃圾邮件功能

    今天邮箱服务器发现有大量发件人为空的邮件等待执行,也就是说空邮件堵塞了队列. 一般来说,空邮件就是别人发送垃圾邮件给你,你的服务上不存在这个收件人,那么系统会产生一封退信告诉你这封邮件已经被退.而ex ...

  3. disabling IPv6 name/address support: Address family not supported by protocol

    禁用IPv6 后影响邮件发送设置 vim /etc/postfix/main.cf # Enable IPv4, and IPv6 if supported inet_protocols = all

  4. mysql 获取当前日期及格式化(转)

    MySQL 获取当前日期及日期格式 获取系统日期: NOW() 格式化日期: DATE_FORMAT(date, format) 注: date:时间字段,format:日期格式 select now ...

  5. 【2-SAT(两次DFS版)】BZOJ1823-[JSOI2010]满汉全席

    [题目大意] 有n个材料,m个评委.每种材料可以被用来做满族菜或汉族菜,m个评委有两种可以让他满意的猜中.问是否可以满足所有评委要求? [思路] 每天只能做三道题,我已经是一个废人了……(葛优躺.jp ...

  6. python3中zipfile模块的常用方法

    一.zipfile模块的简述 zipfile是python里用来做zip格式编码的压缩和解压缩的,由于是很常见的zip格式,所以这个模块使用频率也是比较高的, 在这里对zipfile的使用方法做一些记 ...

  7. 金融应用,计算未来投资回报值 Exercise06_07

    import java.util.Scanner; /** * @author 冰樱梦 * 时间:2018年下半年 * 题目:金融应用,计算未来投资回报值 * */ public class Exer ...

  8. git强行推送到远端

    回到某一个节点git reset --hard 5db4eddeca2然后把现在这个节点,强行推送到远端git push -f origin master

  9. css3的cursor

    1.cursor属性参考表 还有zoom-in/zoom-out 还有grab/grabbing 2.css (1)前面的基本上就 .xx { cursor: pointer; } (2)后面两个有兼 ...

  10. WebLogic Server 12.1.2后的字符型安装模式

    weblogic Server 12.1.1全部都可以用原来方式. WebLogic Server 12.1.2后已经取消了console安装模式,目前只有gui和静默安装模式.并且安装方式下也有很大 ...