4 ms·
> The article misses the other great feature of Mosh: It never get disconnected, regardless of the client's state (IP address change, or device sleep mode), and
by bpizzi 7y ago
> The article misses the other great feature of Mosh: It never get disconnected, regardless of the client's state (IP address change, or device sleep mode), and you will never loose terminal sessions.
I almost switched to mosh in the past while searching for this kind of solution to short-living ssh connections.
But I've finally never made the jump, re-launching ssh/tmux being four keystrokes only (up+enter x2). Not justifying changing the whole paradigm. Plus you get the additional bonus with tmux to be able to recover the same remote terminal sessions when switching computers (leave stuff in place at work, go home, continue on the same stuff at home).
Edit: maybe it's the time for jumping ships!
- kbumsik 7y agoWell, just run tmux with Mosh. It gets even better.
- rmetzler 7y agoExactly. Close the laptop, connect to another network... as soon as you connect the network again you’re still on the server and your long running process still runs there.
- tyingq 7y agoDoes the keepalive functionality in ssh help here? Like: ssh -o ServerAliveInterval=5 -o ServerAliveCountMax=1 $HOST
- kstrauser 7y agoThere’s one place where it doesn’t (and can’t) help at all: when your address is changing frequently. Suppose I’m doing some remote debugging stuff on my way to work. I have one IP on my home Wi-Fi. As I walk to my bus stop, it switches to LTE. As my bus drives through the city, I periodically jump to different addresses. I grab a coffee on my walk to the office and end up on the coffee shop’s Wi-Fi with their address. I leave and hop back to LTE, until I get to work and connect to its Wi-Fi. With SSH, every one of those changes means reconnecting. With Mosh, it means that everything pauses for an instant and then resumes as if nothing ever happened.
- veilrap 7y agoNot really, one of the greatest things about mosh is it's ability to restore connections, even if you put your host to sleep, have a network outage, switch from wired to wireless, and the like. The connection just comes back like magic.