When I work on my server remotely, sometimes my SSH connections get dropped due to network issues. When I re-connect to my server, the dropped sessions remain open. I can see them when I run w
.
I'm aware that I can kill them using their PID, but I would like to auto-kill dropped sessions, if that's possible.
How can I achieve that?