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
  • 相关阅读:
    mac xcode c++ cin cout注意细节一
    linux c++编译问题和虚拟机网络通信
    cocos2d之列表容器节点再排序
    cocos2d之z轴位置示例
    cocos2d之json使用实例
    绑定方法与非绑定方法
    Python 多态与抽象类
    面向对象
    面向对象之继承与派生
    面向对象之类与对象
  • 原文地址:https://www.cnblogs.com/loveapple/p/9927688.html
Copyright © 2011-2022 走看看