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
  • 相关阅读:
    Confluence 6 在升级过程中查看合并日志
    Confluence 6 从 WIKI 标记整合到基于 XHTML 的存储格式
    Confluence 6 升级完成后的检查
    Confluence 6 超过当前许可证期限进行升级
    HDU2571--命运---DP
    HDU 2084 DP经典例子---数塔问题
    紫书第二章
    求组合数
    欧拉函数
    二分幂/快速幂
  • 原文地址:https://www.cnblogs.com/loveapple/p/9927688.html
Copyright © 2011-2022 走看看