It’s so annoying that the connection is lost when going to sleep or network issues. And the solutions to fix this are not really worth the effort.
Closing a stale SSH connection
11–20 of 91 posts
Re: Closing a stale SSH connection
#12I wish there is an easy way to have the reverse: a “sticky” ssh session. It’s so annoying that the connection is lost when going to sleep or network issues. And the solutions to fix this are not really worth the effort.
Re: Closing a stale SSH connection
#13I wish there is an easy way to have the reverse: a “sticky” ssh session. It’s so annoying that the connection is lost when going to sleep or network issues. And the solutions to fix this are not really worth the effort.
Re: Closing a stale SSH connection
#14I wish there is an easy way to have the reverse: a “sticky” ssh session. It’s so annoying that the connection is lost when going to sleep or network issues. And the solutions to fix this are not really worth the effort.
I’m not sure about resuming from sleep, but does mosh address your network stability issues? https://mosh.org/
Re: Closing a stale SSH connection
#15Earlier quoted context omitted.
I’m not sure about resuming from sleep, but does mosh address your network stability issues? https://mosh.org/
The main thing about Mosh is you need both on the sever and the client. Installing on random servers you might be ssh -in only once feels gross.
Re: Closing a stale SSH connection
#16One of the most useful SSH tricks I've ever learned. I wonder if there's a way to detect a stale session and force reconnect when I turn on the computer? Like mosh[0], but with SSH. [0]: https://mosh.org/
I wonder if there's a way to detect a stale session and force reconnect SSH uses TCP and if the session is gone it will be an invalid session in iptables/nftables and likely have timed out on the remote end depending on state table timeouts and how long your laptop were offline. If there were no firewall in the path then one could play with long SO_KEEPALIVE sessions which I have done in the past when rebooting datac…
should be "alluded to"; eluded: evaded / dodged, vs alluded to: mentioned / referred to
NOT being pedantic about spelling, just trying to be helpful (esp. for non-native English readers).
Re: Closing a stale SSH connection
#17I wish there is an easy way to have the reverse: a “sticky” ssh session. It’s so annoying that the connection is lost when going to sleep or network issues. And the solutions to fix this are not really worth the effort.
I run ssh in a loop and auto-attach to a persistent tmux session on the other end. I also kill ssh processes as part of suspend so that the new one gets launched in the loop as soon as we wake up.
Re: Closing a stale SSH connection
#18Earlier quoted context omitted.
I run ssh in a loop and auto-attach to a persistent tmux session on the other end. I also kill ssh processes as part of suspend so that the new one gets launched in the loop as soon as we wake up.
Check out autossh(1)!
Re: Closing a stale SSH connection
#19If you enjoyed this article, you may also find other useful tips in a piece I submitted to HN a while ago on "advanced SSH usage": https://johannes.truschnigg.info/writing/2022-07_advanced_ss...
Re: Closing a stale SSH connection
#20Earlier quoted context omitted.
I wonder if there's a way to detect a stale session and force reconnect SSH uses TCP and if the session is gone it will be an invalid session in iptables/nftables and likely have timed out on the remote end depending on state table timeouts and how long your laptop were offline. If there were no firewall in the path then one could play with long SO_KEEPALIVE sessions which I have done in the past when rebooting datac…
> "As you _eluded_ to" should be "alluded to"; eluded: evaded / dodged, vs alluded to: mentioned / referred to NOT being pedantic about spelling, just trying to be helpful (esp. for non-native English readers).