zoukankan      html  css  js  c++  java
  • Centos7设置关闭防火墙

    CentOS 7.0默认使用的是firewall作为防火墙,要想使用iptables必须重新设置一下。

    1.关闭防火墙

    [root@localhost ~]# systemctl stop firewalld.service

    2.禁止防火墙开机自启

    [root@localhost ~]# systemctl disable firewalld.service

    3.安装iptables service

    yum -y install iptables-services

    4.修改防火墙配置,如增加防火墙端口3306

    vi /etc/sysconfig/iptables 

    增加以下规则

    -A INPUT -m state --state NEW -m tcp -p tcp --dport 3306 -j ACCEPT

    保存退出后

    重启防火墙使配置生效

    [root@localhost ~]# systemctl restart iptables.service

    设置防火墙开机启动

    [root@localhost ~]# systemctl enable iptables.service

    重启系统使设置生效

    [root@localhost ~]# reboot

    注意:mysql安装后,如果不关掉防火墙,则远程不能连接成功。

  • 相关阅读:
    NYOJ 734
    NYOJ 762
    NYOJ 743
    NYOJ 478
    NYOJ 451
    NYOJ 461
    NYOJ 485
    NYOJ 333
    平均互信息
    ASCII码
  • 原文地址:https://www.cnblogs.com/hafiz/p/5874117.html
Copyright © 2011-2022 走看看