• SELinux 宽容模式(permissive) 强制模式(enforcing) 关闭(disabled)


    SElinux共有3中状态。
    1、selinux的配置文件:/etc/selinux/config
    # 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=permissive
      8 # SELINUXTYPE= can take one of three two values:
      9 #     targeted - Targeted processes are protected,
     10 #     minimum - Modification of targeted policy. Only selected processes are     protected.
     11 #     mls - Multi Level Security protection.
     12 SELINUXTYPE=targeted

    enforcing:强制模式,代表 SELinux 运作中,且已经正确的开始限制 domain/type 了; permissive:宽容模式:代表 SELinux 运作中,不过仅会有警告讯息并不会实际限制 domain/type 的存取。这种模式可以运来作为 SELinux 的 debug 之用;

    disabled:关闭,SELinux 并没有实际运作。
    2、查看现在selinux的状态:
    sestatus

    3、永久改变selinux的状态,需要重新开机,因为,selinux是整合到内核的模块。
    4、临时关闭selinux:setenforce 0
    5、临时打开,由permissive转enforcing:setenforce 1
    6、使用sed命令修改selinux的配置文件:
    sed -i '/SELINUX/s/enforcing/disabled/' /etc/selinux/config 
    解说:/SELINUX/为包含匹配以//内字符的行
    s为替换命令
    sed -i 表示直接修改源文件,没有-i只是把修改输出到标准输出,并不修改源文件。
    s/要查找的字符串/改后的字符串/
    注意,整个命令要用单引号引起来。
    最后跟上文件名
  • 相关阅读:
    微信公众平台开发(6) 微信退款接口
    shiro 认证和授权原理
    Shiro架构
    微信公众平台开发(5) 微信客服消息接口
    微信公众平台开发(4) 微信模板消息接口
    微信公众平台开发(3) 企业付款
    微信公众平台开发(1) 通用的工具类CommonUtil
    spring 源码构建
    springMvc配置拦截器无效
    IIdea使用CXF开发WebService
  • 原文地址:https://www.cnblogs.com/litifeng/p/6939730.html
Copyright © 2020-2023  润新知