Wong's Blog

Always on the way forward
  1. 首页
  2. Linux
  3. 正文

Debian系统查看和添加防火墙端口

2023 年 3 月 21 日 126点热度 2条评论

Debian服务器有时候端口会失效,这是因为需要再防火墙打开特定的端口。

查看防火墙状态

iptables -L -n

添加端口

iptables -A INPUT -p tcp --dport /*port*/ -j ACCEPT

删除端口

iptables -D INPUT /*number*/ //iptables -L INPUT中的第几条规则

保存并重启

iptables-save > /etc/iptables.up.rules

/etc/init.d/ssh restart

标签: 暂无
最后更新:2023 年 3 月 21 日

wong

这个人很懒,什么都没留下

点赞
< 上一篇
下一篇 >

文章评论

  • Annalee Rotkovecz

    It’s really a great and useful piece of information. I’m glad that you just shared this helpful info with us. Please stay us informed like this. Thanks for sharing.

    2025 年 4 月 10 日
    回复
  • Bennie Wilderman

    Wow! Thank you! I constantly needed to write on my website something like that. Can I implement a part of your post to my blog?

    2025 年 4 月 15 日
    回复
  • razz evil exclaim smile redface biggrin eek confused idea lol mad twisted rolleyes wink cool arrow neutral cry mrgreen drooling persevering
    取消回复
    • Linux / 6篇
    • Macos / 7篇
    • Windows / 9篇
    • 其他 / 9篇

    在路上 | 2024