zoukankan      html  css  js  c++  java
  • 关闭selinux

    1、查看SELinux状态:getenforce

    Enforcing(启动)

    disable(禁用)

    1、禁用SELinux(重启后依然生效)

    修改 vi /etc/sysconfig/selinux

    [root@developer ~]#  vi  /etc/selinux/config


    # This file controls the state of SELinux on the system.
    # SELINUX= can take one of these three values:
    #     enforcing - SELinux security policy is enforced.
    #     permissive - SELinux prints warnings instead of enforcing.
    #     disabled - No SELinux policy is loaded.
    SELINUX=enforcing

    # SELINUXTYPE= can take one of these two values:
    #     targeted - Targeted processes are protected,
    #     mls - Multi Level Security protection.
    SELINUXTYPE=targeted

    更改其中的SELINUX项的值就可以关闭和启用SELinux服务了。
    修改成  SELINUX=disable     禁用SeLinux
    修改成  SELINUX=enforcing   使用SeLinux

         vi /etc/selinux/conf
         set SELINUX=disabled

    2、不重启让其生效

       /usr/sbin/setenforce 0 立刻关闭 SELINUX

        /usr/sbin/setenforce 1 立刻启用 SELINUX

    3,加到系统默认启动里面

    echo "/usr/sbin/setenforce 0" >> /etc/rc.local

    echo "/usr/sbin/setenforce 0" >> /etc/rc.local

  • 相关阅读:
    2016/3/28 大三下第一月
    hihoCoder1284机会渺茫(唯一分解定理 + 约分)
    瞬沐队小组会议
    本周编程
    团队简介及团队课题
    本周编程
    Python环境的配置
    疫情图表
    本周编程
    返回一个数组中和最大的子数组
  • 原文地址:https://www.cnblogs.com/running-mydream/p/4669468.html
Copyright © 2011-2022 走看看