如何摆脱“mosh”垃圾邮件“last -f /var/log/wtmp”?

如何摆脱“mosh”垃圾邮件“last -f /var/log/wtmp”?

自从我开始使用莫什/var/log/wtmp,我的文件中的条目太多最后(1)在 Linux 机器上。

cnst     pts/8        172.56.2x.yz via Mon May 19 08:19   still logged in
cnst     pts/8        mosh [50892]     Mon May 19 08:19 - 08:19  (00:00)
cnst     pts/8        172.56.2x.yz via Mon May 19 08:18 - 08:19  (00:01)
cnst     pts/8        mosh [50892]     Mon May 19 08:18 - 08:18  (00:00)
cnst     pts/8        172.56.2x.yz via Mon May 19 08:18 - 08:18  (00:00)
cnst     pts/8        mosh [50892]     Mon May 19 08:18 - 08:18  (00:00)
cnst     pts/8        172.56.2x.yz via Sun May 18 20:11 - 08:18  (12:06)
cnst     pts/8        mosh [50892]     Sun May 18 20:11 - 20:11  (00:00)
cnst     pts/8        172.56.2x.yz via Sun May 18 20:11 - 20:11  (00:00)
cnst     pts/8        mosh [50892]     Sun May 18 20:10 - 20:11  (00:00)
cnst     pts/8        172.56.2x.yz via Sun May 18 19:55 - 20:10  (00:15)
cnst     pts/8        mosh [50892]     Sun May 18 19:55 - 19:55  (00:00)
cnst     pts/8        172.56.2x.yz via Sun May 18 19:55 - 19:55  (00:00)
cnst     pts/8        mosh [50892]     Sun May 18 19:55 - 19:55  (00:00)
cnst     pts/8        172.56.2x.yz via Sun May 18 19:24 - 19:55  (00:30)
cnst     pts/8        mosh [50892]     Sun May 18 19:24 - 19:24  (00:00)
cnst     pts/8        172.56.2x.yz via Sun May 18 19:24 - 19:24  (00:00)
cnst     pts/8        mosh [50892]     Sun May 18 19:23 - 19:24  (00:00)

那些 00 小时、00 分钟、登录条目是怎么回事?

有什么方法可以调整 mosh 的参数,使其对报告非常短暂的连接丢失时间不那么严格?

对于如此大声地报告几秒钟的连接问题并不真正感兴趣。

答案1

这是一个已知问题,正如 2012 年添加 utmp 支持后不久的邮件列表讨论中所见:回复:[mosh-users] 登录 wtmp,凯文·温斯坦说

By default, mosh-server adds an entry to utmp (including the user's IP
address) whenever the user becomes active, and replaces it with a
different entry (with just the mosh PID) when they go inactive. This
can help you find abandoned mosh servers.


We don't have a configuration option to change this behavior, but if
you only want the initial utmp entry, you can comment out the source
code in mosh-server.cc that begins "/* update utmp if has been more
than 10 seconds since heard from client */" (near line 678).

也就是说,如果你想改变行为,就必须修改程序。该计划的变更日志没有提到这方面的任何改进。

相关内容