Summary
Killing a detached Mosh session is possible by using the --wipe convenience flag on the client to wrap the grepping and killing of processes
1
, or by using a single command to connect and run screen inside mosh, which will cause other screen clients to exit, taking their surrounding mosh sessions.
1
Additionally, FreeBSD PID randomisation is an option.
2
According to
Summary
Mosh does not support resume or --wipe, but users have suggested that the --wipe convenience flag should be used on the client to wrap the grepping and killing of processes. This would make it clearer when a message appears about a detached session, and a timeout on the server could be used to prevent the process from dying if no client connects in more than 6 hours. Additionally, users have suggested using a single command to connect and run screen inside mosh, which will cause other screen clients to exit, taking their surrounding mosh sessions.
Wipe detached sessions · Issue #426 · mobile-shell/mosh · GitHub
github.com
Summary
Mosh is a technology used to administer FreeBSD, NetBSD, and Linux servers in remote availability zones. It is designed for fault tolerance, so if a session is detached, it is important to kill the process. FreeBSD PID randomisation is an option, and it is good that FreeBSD affords us the option.
Rubenerd: You have detached Mosh sessions on this server
rubenerd.com
With some brainstorming help from the participants from #mosh, I came up with a way to automatically kill old mosh-server processes that probably represented ...
Mosh automatic cleanup of dead sessions
unpythonic.net