V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
Distributions
Ubuntu
Fedora
CentOS
中文资源站
网易开源镜像站
biaoliruyi
V2EX  ›  Linux

如何记录 Linux 端口历史占用日志

  •  
  •   biaoliruyi · 2018-07-24 15:41:39 +08:00 · 3934 次点击
    这是一个创建于 2075 天前的主题,其中的信息可能已经有所发展或是发生改变。

    想记录某些关键端口的历史占用情况,但是 linux 系统日志好像没有。 有什么工具能满足需求推荐下。

    6 条回复    2018-07-24 16:12:04 +08:00
    d0m2o08
        1
    d0m2o08  
       2018-07-24 16:00:39 +08:00
    自己造一个扔到 corn 里
    d0m2o08
        2
    d0m2o08  
       2018-07-24 16:01:10 +08:00
    @d0m2o08 cron 这操蛋的键盘
    biaoliruyi
        3
    biaoliruyi  
    OP
       2018-07-24 16:08:15 +08:00
    @d0m2o08 shell 不是强项(运维人跑了开发顶上) 看了下 cron 最小精度是分钟不太能满足我的需求
    reus
        4
    reus  
       2018-07-24 16:09:33 +08:00
    iptables -I INPUT -p tcp --dport some_port -j LOG
    reus
        5
    reus  
       2018-07-24 16:10:35 +08:00
    google "linux log port state"
    BOYPT
        6
    BOYPT  
       2018-07-24 16:12:04 +08:00
    写个 while true 的脚本,把 ss 的输出 dump 到文件
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2932 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 30ms · UTC 14:09 · PVG 22:09 · LAX 07:09 · JFK 10:09
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.