分享

阿里云轻量级服务器的日常操作

 精品唯居 2022-12-14 发布于北京

1、使配置文件生效: source /etc/profile

2、查看配置环境path: echo $PATH

3、查看端口号: netstat -ano

  查看当前运行程序的端口:netstat -anpl | grep LISTEN

4、启动防火墙:systemctl start firewalld     关闭防火墙:systemctl stop firewalld    重启防火墙:systemctl restart firewalld

5、禁止开机启动防火墙:systemctl disable firewalld    设置开机自动启动防火墙:systemctl enable firewalld.service

6、查看防火墙状态:firewall-cmd --state    重新刷新防火墙:firewall-cmd --reload

7、查看防火墙开通的端口:

  firewall-cmd --permanent --list-ports

  firewall-cmd --zone=public --list-ports

  firewall-cmd --list-all

  查看是否开通3306端口:firewall-cmd --query-port=3306/tcp

8、开放8080端口:firewall-cmd --zone=public --permanent --add-port=8080/tcp

9、开放3306端口:firewall-cmd --zone=public --add-port=3306/tcp --permanent

  (注意:开放端口其实方法都可以,只要把端口号改了就可以)

10、移除8080端口:firewall-cmd --permanent --remove-port=8080/tcp

参考:https://blog.csdn.net/wbyzl1/article/details/105789522

  

    本站是提供个人知识管理的网络存储空间,所有内容均由用户发布,不代表本站观点。请注意甄别内容中的联系方式、诱导购买等信息,谨防诈骗。如发现有害或侵权内容,请点击一键举报。
    转藏 分享 献花(0

    0条评论

    发表

    请遵守用户 评论公约

    类似文章 更多