zoukankan      html  css  js  c++  java
  • SELinux安全系统基础

    一、SELinux简介

    SELinux(Secure Enhanced Linux)安全增强的Linux是由美国国家安全局NSA针对计算机基础结构安全开发的一个全新的Linux安全策略机制。SELinux可以允许系统管理员更加灵活的来定义安全策略。

    SELinux是一个内核级别的安全机制,从Linux2.6内核之后就将SELinux集成在了内核当中,因为SELinux是内核级别的,所以我们对于其配置文件的修改都是需要重新启动操作系统才能生效的。

    现在主流发现的Linux版本里面都集成了SELinux机制,CentOS/RHEL都会默认开启SELinux机制。

    四、SELinux模式

    SELinux的工作模式一共有三种 enforcing、permissive和disabled 

    enforcing  强制模式:只要是违反策略的行动都会被禁止,并作为内核信息记录

    permissive 允许模式:违反策略的行动不会被禁止,但是会提示警告信息

    disabled  禁用模式:禁用SELinux,与不带SELinux系统是一样的,通常情况下我们在不怎么了解SELinux时,将模式设置成disabled,这样在访问一些网络应用时就不                     会出问题了。

    SELinux的主配置文件是 /etc/sysconfig/selinux 

    [root@xiaoluo ~]# cat /etc/sysconfig/selinux 
    
    # 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  //  我们看到SELinux默认的工作模式是enforcing
    # SELINUXTYPE= can take one of these two values:
    #     targeted - Targeted processes are protected,
    #     mls - Multi Level Security protection.
    SELINUXTYPE=targeted

    临时关闭SELinux 
    setenforce 0

    临时打开SELinux 
    setenforce 1

    查看SELinux状态 
    getenforce

    开机关闭SELinux 
    编辑/etc/selinux/config文件,将SELINUX的值设置为disabled。下次开机SELinux就不会启动了。

    参考资料:

    https://www.cnblogs.com/xiaoluo501395377/archive/2013/05/26/3100444.html

  • 相关阅读:
    POJ 1469 COURSES 二分图最大匹配
    POJ 1325 Machine Schedule 二分图最大匹配
    USACO Humble Numbers DP?
    SGU 194 Reactor Cooling 带容量上下限制的网络流
    POJ 3084 Panic Room 求最小割
    ZOJ 2587 Unique Attack 判断最小割是否唯一
    Poj 1815 Friendship 枚举+求最小割
    POJ 3308 Paratroopers 最小点权覆盖 求最小割
    1227. Rally Championship
    Etaoin Shrdlu
  • 原文地址:https://www.cnblogs.com/domestique/p/7977117.html
Copyright © 2011-2022 走看看