在安装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. 13、Django实战第13天:分页列表功能

    我们看课程 机构列表页是需要分页的 为了完成分页功能,我们需要用到Django的一个开源开发库django-pure-pagination workon mxonline pip install dj ...

  2. oracle tablespace usage status

    select a.tablespace_name, a.bytes / 1024 / 1024 "Sum MB", (a.bytes - b.bytes) / 1024 / 102 ...

  3. JavaScript函数中的参数(arguments)

    arguments argument是JavaScript中的一个关键字,用于指向调用者传入的所有参数. function example(x){ alert(x); alert(arguments. ...

  4. [PKUSC2018]最大前缀和(DP)

    题意:求一个序列随机打乱后最大前缀和的期望. 考场上发现不管怎么设状态都写不出来,实际上只要稍微转换一下就好了. 一个前缀[1..k]是最大前缀,当且仅当前面的所有后缀[k-1,k],[k-2,k], ...

  5. 【费用流】bzoj1520 [POI2006]Szk-Schools

    注意:建图的时候,一定要把旧标号相同的分开. #include<cstdio> #include<algorithm> #include<cstring> #inc ...

  6. 6.4(java学习笔记)转换流

    一.乱码问题 我们来看下列例子: public class ConStream { //当前平台默认采用GBK public static void main(String[] args){ Stri ...

  7. binlog监听工具-canal

    官网 https://github.com/alibaba/canal/wiki

  8. Linq 简明教程

    一个简单的实例 static void Main(string[] args) { string[] names = { "Alonso", "Zheng", ...

  9. C# log4net打不出日志 (IIS项目)

    配置文件都配了,引用也引用了,调用也是对的,网上找博客也找不到,疯掉了. 后来腆着脸问了一个前辈,他告诉我的,添完就好了. 给项目的这个文件,添加这行代码: [assembly: log4net.Co ...

  10. nginx+ssl+Portus+registry docker仓库

    还存在的问题,如果通过nginx 转发推过去的镜像,在web页面显示比较慢,需要等定时任务发现了才能及时显示出来,如果通过b.p.xxx.cn:5000加端口push 的镜像就比较快显示出来.只影响到 ...