zoukankan      html  css  js  c++  java
  • centos 7.X关闭防火墙和selinux

    一、关闭防火墙

    centos从7开始默认用的是firewalld,这个是基于iptables的,虽然有iptables的核心,但是iptables的服务是没安装的。

    所以你只要停止firewalld服务即可:
    sudo systemctl stop firewalld.service && sudo systemctl disable firewalld.service

    如果你要改用iptables的话,需要安装iptables服务:
    sudo yum install iptables-services
    sudo systemctl enable iptables && sudo systemctl enable ip6tables
    sudo systemctl start iptables && sudo systemctl start ip6tables

    二、关闭selinux

    Linux在安装好之后通常SELinux都是出于默认开启的状态,开启的情况下会导致一些服务的安装不成功。

    在不需要的情况下完全可以关闭掉,下面是在centos 7.0里面如何查看,关闭selinux。

    查看selinux状态

    #sestatus

     

    临时关闭

     #setenforce 0
     

    永久关闭

    可以修改配置文件/etc/selinux/config,将其中SELINUX设置为disabled

     
    [root@localhost ~]# cat /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  
    SELINUX=disabled  
    # SELINUXTYPE= can take one of three two values:  
    #     targeted - Targeted processes are protected,  
    #     minimum - Modification of targeted policy. Only selected processes are protected.   
    #     mls - Multi Level Security protection.  
    SELINUXTYPE=targeted
     
    [root@rdo ~]# sestatus  
    SELinux status:                 disabled
  • 相关阅读:
    GetSystemMetrics SM_** 系统消息
    Direct3D中的HLSL
    Delphi TStream 详细介绍
    VI命令详解(大全)
    Delphi中messagedlg
    Windows中的消息详细列表
    SharePoint2007深入浅出——开发环境配置
    深入浅出InfoPath——预备式
    SharePoint术语对照表
    深入浅出Nintex——判断当前用户的角色
  • 原文地址:https://www.cnblogs.com/loveapple/p/9927688.html
Copyright © 2011-2022 走看看