阿里云CentOS开放端口

  1. 如我们需要开启XShell连接时需要使用的8080端口:

    firewall-cmd --zone=public --add-port=8080/tcp --permanent
    

    其中–permanent的作用是使设置永久生效,不加的话机器重启之后失效

  2. 重新载入一下防火墙设置,使设置生效

    firewall-cmd --reload
    
  3. 登录阿里云控制台,添加安全组规则
    在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/qwqw3333333/article/details/85222528