top | item 28150287

Mosh: The Mobile Shell

449 points| chrisaycock | 4 years ago |mosh.org | reply

153 comments

order
[+] shp0ngle|4 years ago|reply
Note that Mosh has not had release for 4 years, even when pull requests are accepted on github, and the team lead says "we are too busy/burned out".

https://github.com/mobile-shell/mosh/issues/1115

[+] keithwinstein|4 years ago|reply
I think the truth is that we don't feel like we need a release. We've never had a security hole, our track record speaks for itself, and I wouldn't really want us to rush anything and blow that. There are some features that it would be really nice to have in a release (like 24-bit color support, and working around a recent MacOS clock bug), but I handed over the maintainership to somebody else about six years ago and that person is currently, I think, dealing with a bunch of stuff (look around the world the last year...). I'm not eager to step back in and bigfoot them -- especially when I'm no longer particularly familiar with the codebase (and recent commits) as I used to be.

Mosh works as advertised and has never had a security hole -- we're pretty proud of that! We'll probably cut a release at some point to add those features (24-bit colors, the MacOS clock workaround) but I'm not feeling like it's urgent enough to upset what I had hoped was a transition plan.

It would feel arrogant to compare Mosh to TeX, but it doesn't seem that crazy to imagine that some software might reach a point where it has accomplished 95% of its goals, and the benefit from adding further features has to be weighed against the risk of introducing a security hole or other regression through further churn. If the TCP specification, or OpenSSH, or TeX, or GNU bash had canonical GitHub repositories, they would probably be full of a bunch of user support issues and inactive PRs too. :-)

[+] eyelidlessness|4 years ago|reply
As someone over a year into a burnout... good for them for guarding themselves from overextending. Maintaining a project is hard even if you have the whole of your energy and attention to devote. It's a lot harder when you're trying to power through.

I've held off finishing and releasing half a dozen projects over the last year because while I think they'd be useful I know I don't have bandwidth to support them.

[+] OtomotO|4 years ago|reply
Finally, software that is considered finished and no "featuritis" taking over. I love that!

KISS all the way!

[+] devin|4 years ago|reply
i didn't know that, and that bums me out. is what's there good enough to not care that there aren't frequent updates?
[+] keithwinstein|4 years ago|reply
Mosh original author here -- fun to see us back here yet again. Happy to answer any questions.
[+] diekhans|4 years ago|reply
All I can say is THANK YOU!!! I use mosh 10+ hours a day. Maybe it needs a bit of help, but it is in my top 10 of "how did I accomplish anything with out mosh.
[+] nmstoker|4 years ago|reply
It looks like there's no sponsorship for Mosh. Had this been considered?

Not saying money would solve the challenges the maintainer faces but there might be things it eases. With a tool this popular I expect it wouldn't struggle to raise a fair bit.

[+] cpach|4 years ago|reply
Thank you for writing mosh. It’s an awesome tool, especially when using the laptop on a train.
[+] na85|4 years ago|reply
Are you planning on addressing some of the long-standing issues relating to e.g. Unicode rendering?
[+] hcrean|4 years ago|reply
It is a VERY useful tool that I have used every day for at least 3 years.

There are two really annoying niggles that I have with it, but both I have solved by using a Screen session on the server:

- Scrolling turns out to be very important to most workflows. The choice to start mosh in Append mode (with chance of output corruption) rather than replace mode would be a cool thing.

- There is no easy way to pick up a session again when the client dies. I understand that this is an intended security "feature" though.

But beyond this it is a truly fabulous tool that has saved me many many hours of frustration.

[+] jhrmnn|4 years ago|reply
Such an indispensable tool! I’m running mosh+tmux 24/7 on my remote desktop and every day just open my laptop, connect to VPN and continue where I left off the previous day
[+] jwr|4 years ago|reply
Thank you for creating a fantastically useful tool. I use it every day, it works very well, and I'd be happy to contribute to your Github sponsors account.
[+] mcstafford|4 years ago|reply
I'm unable to use mosh after switching VPN clients, though ssh works. What should I discuss and/or request with the security+network folks?
[+] slim|4 years ago|reply
Vim or emacs ? (serious question)
[+] dang|4 years ago|reply
Some past threads:

Blink Mobile Shell for iOS (Mosh Based) - https://news.ycombinator.com/item?id=18370348 - Nov 2018 (1 comment)

Mosh: the mobile shell - https://news.ycombinator.com/item?id=12429203 - Sept 2016 (49 comments)

Mosh: the mobile shell - https://news.ycombinator.com/item?id=11572146 - April 2016 (148 comments)

Mosh – a robust, responsive replacement for SSH - https://news.ycombinator.com/item?id=8928506 - Jan 2015 (45 comments)

Ask HN: Anyone using Mosh? Seems development has stalled since January - https://news.ycombinator.com/item?id=8556680 - Nov 2014 (1 comment)

Mosh: A replacement for SSH - https://news.ycombinator.com/item?id=8252093 - Sept 2014 (122 comments)

Mosh (mobile shell) - https://news.ycombinator.com/item?id=6321474 - Sept 2013 (6 comments)

Mosh: the mobile shell - https://news.ycombinator.com/item?id=5016745 - Jan 2013 (89 comments)

Mosh: the mobile shell - https://news.ycombinator.com/item?id=4588239 - Sept 2012 (1 comment)

Mosh: SSH for 2012 - https://news.ycombinator.com/item?id=3819382 - April 2012 (193 comments)

Mosh: the mobile shell - https://news.ycombinator.com/item?id=3814589 - April 2012 (2 comments)

[+] d4l3k|4 years ago|reply
Adding port forwarding to Mosh has a $600 bounty -- highest OSS bounty I've ever seen

https://www.bountysource.com/issues/4471419-ssh-port-forward... https://github.com/mobile-shell/mosh/issues/337

[+] codetrotter|4 years ago|reply
As someone that used to use SSH port forwarding, I have a recommendation that may be a suitable alternative to the lack of port forwarding in Mosh, as well as being an alternative to port forwarding over SSH. Wireguard! This is what I do instead of port forwarding over SSH since quite a while back now.

I run a Wireguard VPN on a VPS, and have machines connect to that VPN. This allows me to reach the machines on the VPN from almost anywhere in the world. Recently I changed the port that Wireguard is listening on to port 443 UDP, which also allows me to connect to my VPN from a few public WLANs that are very restrictive on which ports they allow outbound traffic to.

Wireguard is super easy to configure and run, and very secure.

Definitely give Wireguard a go. It's open source and awesome.

[+] gnyman|4 years ago|reply
there is a fork with port forwarding support https://github.com/rinne/mosh and a PR with a long discussion https://github.com/mobile-shell/mosh/pull/696 on why it's not merged

you can compile them yourself or if you want to skip the step I recently set up GitHub actions to compile linux binaries of this [1][2], tested by a sample of 1 so no guarantees it works, was planning on doing a tap PR/tap of it at some point

also the official developers have been involved a project to solve this while improving the whole-agent approval things also https://github.com/StanfordSNR/guardian-agent , but I couldn't get it to work which is why I tried the fork and got that working

[1] https://github.com/gnyman/mosh/actions/runs/1068715036 [2] https://github.com/gnyman/mosh/actions/runs/1068715035

[+] na85|4 years ago|reply
I love mosh. It's great on slow connections of any sort, but particularly great on phones.

On short/medium trips I no longer bring a laptop. Just my phone and my bluetooth keyboard. I have successfully updated my rspamd DKIM signing config from a hotel lobby, among other things, with just those devices and mosh.

Mosh is great.

[+] themodelplumber|4 years ago|reply
I'm curious, do you use any kind of terminal windowing, or what do you do about dividing up screen space / multitasking on your phone? This is one thing I really like on my laptop--multitasking with the side-by-side advantage, by keeping various windows visible at once, and using virtual workspaces with hotkeys assigned. Anyway, cool to read your endorsement.
[+] flyinghamster|4 years ago|reply
Trying to use SSH via LTE over a mobile phone hotspot was downright horrible. It took ridiculous keepalive settings and a separate window pinging the destination to make it even halfway usable.

Then someone on another HN thread mentioned mosh. That was just what the doctor ordered. It's something I've wished I knew about years ago, given that it's also useful when Wi-Fi gets dodgy.

[+] yoavm|4 years ago|reply
Love mosh, back when the connection was bad I had it aliased to ssh. Somewhat relevant: if you actually a need to take your shell mobile, check out my tmux plugin that allows you to quickly transfer your tmux session to your phone without any app, using websockets and a QR code: https://github.com/bjesus/muxile
[+] jacob019|4 years ago|reply
I typically use ssh over wireguard and tmux if I need persistent sessions. Wireguard takes care of the unstable remote link and changing IPs. I can suspend my laptop on one connection, wake it up later on another and still have an active session. I use openssh via Termux for the client on Android or whatever terminal emulator on the laptop. Can mosh offer me anything?
[+] chousuke|4 years ago|reply
mosh has very good latency hiding and your connection can actually be interrupted for longer than a TCP session would tolerate.

The latency hiding alone makes it worth it; SSH is miserable over links with any lag, mosh feels as responsive as typing locally until you get into hundreds of milliseconds of latency.

[+] Jtsummers|4 years ago|reply
My setup is iPad + MBP + Linux server. I use mosh to connect, also with a Wireguard VPN, and have tmux running on the server. It's very convenient to pop open Blink on my iPad and have everything right where I left it (modulo changes made while on the MBP) and the reverse when I pull up the terminal on my MBP.

The main benefit for me is mobility, though, not the restore from sleep itself. When I started using this setup I was traveling quite a bit, including just locally (living in a downtown area, I'd start on something in the apartment, then decide to go to the coffee shop, or the growler place, and continue working). Not having to reestablish the connection (even using SSH certs that's still some friction) was very pleasant.

The second is when dealing with an unreliable network. Though this is less common these days, when I started with it I had a lot of issues in my apartment thanks to a neighbor with a noisy microwave oven.

[+] foxpurple|4 years ago|reply
Mosh apparently fixed the lag issue where typing is very slow on far away servers. Trying to ssh a server on the other side of the world is annoying.
[+] brunoqc|4 years ago|reply
> Wireguard takes care of the unstable remote link and changing IPs.

Isn't that the point of mosh?

"Remote terminal application that allows roaming, supports intermittent connectivity, and provides intelligent local echo and line editing of user keystrokes."

[+] Teknoman117|4 years ago|reply
Mosh is the only reason I can bear working over a satellite internet connection. The local echo is fantastic. It's also fantastic for working over VPN connections where the tunnel collapses occasionally and you don't want to lose 30 active sessions.
[+] Per_Bothner|4 years ago|reply
DomTerm has nice remote-terminal solution: https://domterm.org/Remoting-over-ssh.html . Compared to mosh is supports a much more complete xterm-like terminal, full scrollback, runs on Windows (using WSL), does not require superuser/admin access (runs on top of plain ssh), has an integrated tmux-style multiplier, and is actively developed. Like mosh it has predictive echo, and detach/attach. It also has an optional local-input-edit mode (used by default if the remote terminal is in icanon mode). An easily-installable AppImage is available (https://github.com/PerBothner/DomTerm/releases). Feedback welcome.
[+] codesections|4 years ago|reply
I know the pace of development has been pretty slow for the past few years — but Mosh is a good enough idea that I really hope it picks up steam again (better true color support, for one thing, would be a big feature)
[+] anamexis|4 years ago|reply
Agreed, I think it's an already-fantastic tool that is a bit of polish away from being perfect. My number one gripe is the lack of scrollback.
[+] doomrobo|4 years ago|reply
Big fan of Mosh for what it does. But the fact that it can't render Unicode properly makes it really hard to work with some files remotely. IIRC there's a PR that fixes and has never been merged
[+] linsomniac|4 years ago|reply
I've been watching mosh for years, but I kept running into some sort of environment/locale issue that was getting in the way. Finally, a couple months ago I got "Linux (Beta)" available for my Chromebook and switched to using it rather than a Chrome SSH plugin to login to my work computers.

I started up mosh and it's been glorious! I used to have to reconnect every time my chromebook went to sleep for any length of time, but now I've had a single session open for ~6 weeks.

It has a nice banner when it loses connectivity, so I immediately know there are network/VPN issues. I don't love the "Control-^" escape key, because it interferes with "Last buffer" in vi, but otherwise it's worked flawlessly.

A decade or so ago I pointed a client at mosh, he had a rural property with satellite Internet and he managed a bunch of other peoples computers. He was overjoyed with mosh!

[+] larodi|4 years ago|reply
been expecting for a native windows of the tool for some while, pity that there is none. apart from that - it works like charm indeed.
[+] notorandit|4 years ago|reply
It's a neat solution, indeed. But is that actually viable and useful? Not sure. First, you need to open firewalls to UDP port ranges. Second, you still need SSH to be in place and reachable. Third, as soon as you kick off mosh you loose all bells and whistles by SSH (like TCP forwarders, SOCKS proxies etc.).

So my idea is: nice for amateur small infrastructures, pretty useless for real world (cloud) infras. Maybe you can make mosh-reachable a bastion or two, but no more than that.

Nonetheless, i stress, it's a neat idea.

[+] treesknees|4 years ago|reply
Not useless, you just need to think about how to use the tool in a different way. I use mosh to login to a stable jump box and then from there use tmux/ssh to branch out all my sessions to cloud infrastructure or other devices that only accept ssh.
[+] gorgoiler|4 years ago|reply
Local echo always felt like a handy feature for any kind of laggy terminal app, not just ssh / mosh.

I imagine such a tool would emulate a terminal a la screen / tmux, and just print what you type until the underlying program outputs to stdout, at which point it undoes what you typed and replays the stdout? I realise I may be betraying a complete lack of understanding of how Unix terminals actually work :)

Is there a Unix utility that implements a local-echo wrapper?

[+] tmsbrg|4 years ago|reply
Hmm, rlwrap[0] is a really nice tool when working with applications that are poor at handling terminal input. It basically handles your keystrokes in rlwrap and whenever you type enter it will send the input line to the application to handle. It's very useful also for application that don't have their own input handling (arrow keys, etc.) or have extreme keystroke latency. It will even give you ctrl+r feature to search commands you typed earlier.

I use it often for pentesting when getting a raw reverse shell. I'll get access to a remote bash session through netcat, and using rlwrap I can do the line editing locally and find the complex commands I've written before without copypaste.

[0] https://linux.die.net/man/1/rlwrap

[+] emersonrsantos|4 years ago|reply
This mimics a lot how 3270 devices work, by transmitting chunks instead of individual keystrokes. The IBM 3270 technology dates from 1970!
[+] tyingq|4 years ago|reply
Sort of. Local echo and "smart current line editing" aren't quite the same as block mode, forms, etc. To me, a html form is closer to what 3270 is.
[+] wirthjason|4 years ago|reply
I always want to try alternative shells but I always come back to bash. I think Fish had the longest residency. I have yet to find the killer reason to never come back.

It’s a bit like programming languages. So much cool stuff out there but it’s hard for me to leave Python. Like Bash, everything works with it.

I’m curious what people’s “killer apps” are for permanently changing shells.

[+] arsome|4 years ago|reply
mosh isn't an alternative shell, it's sort of like "rsh" or "ssh" except designed for mobile... and using SSH for authentication and session setup.
[+] edgyquant|4 years ago|reply
I have this same problem. I’ve tried fish and zsh but all my scripts are in bash and over the years I’ve honed an environment I can just git clone to any Linux machine and it works
[+] perryizgr8|4 years ago|reply
I found et which works better than mosh in some respects. It supports scrolling, and seems faster to respond.
[+] technofiend|4 years ago|reply
Mosh is perfect for ephemeral client connections to a long-standing session. My ipad likes to kill ssh sessions every time the screen locks. But using mosh insulates me from that and I just go back to a hot shell with no interruption.