zoukankan      html  css  js  c++  java
  • centos 端口及防火墙

    端口问题

    Centos查看端口占用情况命令,比如查看80端口占用情况使用如下命令:
    lsof -i tcp:80

    列出所有端口
    netstat -ntlp

    查询已打开的端口
    sudo ss -plant|grep 22

    查看服务器sshd状态
    sudo systemctl status sshd

    开启服务器sshd服务
    sudo systemctl start sshd

    查看已开放的端口
    firewall-cmd --list-ports

    开放端口(开放后需要要重启防火墙才生效)
    firewall-cmd --zone=public --add-port=3338/tcp --permanent

    防火墙问题

    重启防火墙
    firewall-cmd --reload

    关闭端口(关闭后需要要重启防火墙才生效)
    firewall-cmd --zone=public --remove-port=3338/tcp --permanent

    开机启动防火墙
    systemctl enable firewalld

    开启防火墙
    systemctl start firewalld

    禁止防火墙开机启动
    systemctl disable firewalld

    停止防火墙
    systemctl stop firewalld

    本博客所有内容均为学习日记,如有错误,烦请指正;如有侵权,请联系作者删除。 有关文章内容方面,请尽情留言,大家相互探讨
  • 相关阅读:
    python函数内容
    python读写csv文件
    python正则表达式
    python使用MYSQL数据库
    python简单面试题
    python执行cmd命令
    python详解json模块
    我的自动化测试之路
    测试开发这一年
    招聘测试人员,我在面试什么?
  • 原文地址:https://www.cnblogs.com/nvyuan/p/15019258.html
Copyright © 2011-2022 走看看