Mosh (Mobile Shell) for dealing with intermittent connections

What is Mosh useful for?

Sometimes you are in an environment where network connectivity is flakey or intermittent, or you end up moving between different wireless access points that don’t support transparently roaming between them without changing your ip address. In these cases your SSH session can fail frequently. Depending on the work you are doing the best answer might be to run a screen or tmux session that allows your processes to stay alive when your network connection drops. But if the drops are frequent enough the hassle of doing this can still be frustrating. Mosh is another option that can help you stay productive with less interruptions.

Mosh is an SSH-like remote access protocol that uses UDP for network traffic, enabling it to be able to heal connection issues faster when network connectivity is less than ideal. A mosh session is bootstrapped by starting an SSH session to establish trust, and then moving into a separate fully-encrypted UDP-based connection. Because Mosh uses UDP for transport it’s more likely to be filtered by aggressive firewalls (especially on public WiFi access points), so it isn’t always the right tool to use. Mosh is also less like SSH and more like a remote dumb terminal that transmits your keystrokes to the server and, and information about what the terminal looks like on the other end back to the client. This means that mosh is only a substitute for SSH when you desire the human-interactive aspect, mosh can’t tunnel traffic or do any of the other fancy tricks that SSH can do.

How to get a mosh client?

You will need to get a mosh client for your platform/device. Details can be found at:

What systems can you access via Mosh?

A handful of systems are externally accessible via mosh – including ada/babbage.cs and ruby/rita.cs. Most lab computers will not allow mosh connectivity unless you are on the VPN.