在安装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. 二维偏序+树状数组【P3431】[POI2005]AUT-The Bus

    Description Byte City 的街道形成了一个标准的棋盘网络 – 他们要么是北南走向要么就是西东走向. 北南走向的路口从 1 到 n编号, 西东走向的路从1 到 m编号. 每个路口用两个 ...

  2. 二分+Dfs【p1902】刺杀大使

    题目描述--->p1902 刺杀大使 题意概括: 找一条路径,使得从第1行到第n行路径的最大值最小. 分析: 题目概括出来,很容易想到二分. 求最大值最小,因此我们可以对最大伤害值进行二分. 如 ...

  3. noi 题库1.7字符串 第16至20题

    16:忽略大小写的字符串比较 一般我们用strcmp可比较两个字符串的大小,比较方法为对两个字符串从前往后逐个字符相比较(按ASCII码值大小比较),直到出现不同的字符或遇到'\0'为止.如果全部字符 ...

  4. Robot Framework与Web界面自动化测试:简单例子

    假设环境已经搭建好了.这里用RIDE( Robot Framework Test Data Editor)工具来编写用例.下面我们对Robot Framework简称rf. 我们先考虑下一个最基本的登 ...

  5. 【点分治】bzoj1468 Tree

    同poj1741. 换了个更快的姿势,不会重复统计然后再减掉什么的啦~ #include<cstdio> #include<algorithm> #include<cst ...

  6. 冒泡排序--注意flag变量的设置

    代码: #include<stdio.h> void BubbleSort(int a[],int n){ int i,j; int temp; ; // 此处flag变量的设置可以提高算 ...

  7. SQL Server on Linux: How? Introduction: SQL Server Blog

    SQL Server Blog Official News from Microsoft’s Information Platform https://blogs.technet.microsoft. ...

  8. Instant Run 的操作影响到了代码,导致Android App启动闪退的问题

    转自yuhc163原文android启动应用java.lang.NoClassDefFoundError: Class not found using the boot class loader; n ...

  9. javascript常见的数组方法

    1:Array对象用于在单个变量中存储多个值typeof(arrArr) 'object'var arr1 = [];//创建一个空数组eg:数组是个引用类型var a = [1,2,3];var b ...

  10. crontab定时任务详解

    1.安装crontab:yum install crontabs 说明:/sbin/service crond start //启动服务/sbin/service crond stop //关闭服务/ ...