码迷,mamicode.com
首页 > 其他好文 > 详细

centos7的一些基本操作

时间:2015-10-08 20:14:04      阅读:225      评论:0      收藏:0      [点我收藏+]

标签:

  1. 防火墙的开启与关闭

  2. ?     centos7的防火墙设置和以前不一样了,一定要注意。</br>
        

    It is possible to go back to a more classic iptables setup. First, stop and mask the firewalld service:

    systemctl stop firewalld
    systemctl mask firewalld

    Then, install the iptables-services package:

    yum install iptables-services

    Enable the service at boot-time:

    systemctl enable iptables

    Managing the service

    systemctl [stop|start|restart] iptables

    Saving your firewall rules can be done as follows:

    service iptables save

    or

    /usr/libexec/iptables/iptables.init save

    2.开启端口

    开启端口
    firewall-cmd --zone=public --add-port=80/tcp --permanent

    命令含义:
    --zone #作用域
    --add-port=80/tcp #添加端口,格式为:端口/通讯协议
    --permanent #永久生效,没有此参数重启后失效

    重启防火墙
    firewall-cmd --reload

    参考:https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/Security_Guide/sec-Using_Firewalls.html

    ?

centos7的一些基本操作

标签:

原文地址:http://my.oschina.net/u/860872/blog/514421

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!