News for hackers. Stuff that matters.
Re:Closing a Stale SSH Connection by hartator on Sunday April 09, 2023 @02:16PM (#35505078)
I 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 by donio on Sunday April 09, 2023 @02:27PM (#35505159)
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 by granddave on Sunday April 09, 2023 @02:57PM (#35505399)
Check out autossh(1)!
Re:Closing a Stale SSH Connection by rmbyrro on Sunday April 09, 2023 @03:03PM (#35505465)
Re:Closing a Stale SSH Connection by rsfern on Sunday April 09, 2023 @02:19PM (#35505092)
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 by hartator on Sunday April 09, 2023 @02:29PM (#35505190)
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 by devman0 on Sunday April 09, 2023 @02:47PM (#35505332)
Has Mosh crypto been reviewed? Last I checked they were using some custom crypto on top of UDP instead of using something like DTLS or QUIC. Given SSH is one of the most battle tested protocols out there I am wary of replacing it with something else.
Re:Closing a Stale SSH Connection by lwf on Sunday April 09, 2023 @04:02PM (#35505944)
https://mosh.org/#faq:~:text=Q%3A%20What%20is%20Mosh%27s%20s...

The cryptography is standard AES-128 in OCB3 mode. It's been around long enough, and has had enough security scrutiny to at least discover a few minor DoS vulnerabilities, that it isn't entirely unreviewed.

For the cipher itself, see https://en.wikipedia.org/wiki/OCB_mode#Attacks

Re:Closing a Stale SSH Connection by gsich on Sunday April 09, 2023 @04:34PM (#35506229)
It was AES-OCB last time I looked at it. Not sure if this is good/bad.
Re:Closing a Stale SSH Connection by firstlink on Monday April 10, 2023 @03:02PM (#35516030)
> QUIC

Mosh has been effectively unmaintained since long before QUIC even existed. It should be rewritten to use QUIC, except that QUIC's requirement for TLS certificates rather than generic asymmetric cryptography basically breaks any integrations like this.

Re:Closing a Stale SSH Connection by summarity on Sunday April 09, 2023 @05:19PM (#35506568)
et survives reboots and IP roaming, pretty much anything: https://eternalterminal.dev/
Re:Closing a Stale SSH Connection by quectophoton on Monday April 10, 2023 @04:10AM (#35510197)
WireGuard[1] might help here, at least with network issues. It's literally designed to be able to keep a connection even when moving to one network to another ("roaming").

And as a side-benefit, if your SSH daemon only listens on the WireGuard interface, that's another layer of defense you get for free (not to mention you'll stop getting noise in your logs).

Ironically though, here you actually need to know about `<Enter>~.` because if the remote host actually goes down, WG will keep trying to contact the remote peer for some time; this is the same behavior that allows you to keep a connection open even when roaming, but seen from the other side.

[1]: https://www.wireguard.com/