What Is Mosh on mosh.org?
Updated
Mosh (mobile shell) is a remote terminal application and a replacement for interactive SSH terminals, distributed as free software from mosh.org. It is designed for unstable or high-latency connections: it supports roaming between networks, survives intermittent connectivity and sleep/wake cycles, and gives instant local echo of your typing. It runs on GNU/Linux, BSD, macOS, Solaris, Android, Chrome, and iOS. Choose it when you work over Wi-Fi, cellular, or long-distance links and want a session that stays alive and feels responsive; stick with plain SSH if you need a minimal, universally installed tool or cannot use UDP.
What problem it solves
Standard SSH ties a session to a TCP connection and waits for the server's reply before displaying your keystrokes. On a slow or flaky link, that means laggy typing and a session that dies when your IP address changes. Mosh addresses both:
- Roaming: it keeps you logged in as you move between connections — Wi-Fi on a train, Ethernet in a hotel, LTE elsewhere. Most network programs, including SSH, drop the connection on roaming.
- Intermittent connectivity: you can suspend your laptop and resume later with the connection intact. If the network drops, Mosh warns you and resumes when service returns.
- Responsiveness: typing, deleting, and line editing respond instantly, adaptively, even inside full-screen programs like emacs and vim. On a bad connection, unconfirmed predictions are underlined so you are not misled.
- Robustness under loss: the UDP-based protocol handles packet loss gracefully and sets its frame rate from network conditions. It does not fill network buffers, so Control-C reliably halts a runaway process.
How it works and what it does not change
Mosh is a command-line program like ssh, run inside xterm, gnome-terminal, urxvt, Terminal.app, iTerm, emacs, screen, or tmux. It does not listen on network ports or authenticate users itself. Instead:
- The
moshclient logs in to the server over SSH using your existing credentials (password or public key). - It starts
mosh-serverremotely and connects to it over UDP.
No superuser privileges are needed to install or run it, and no daemon persists: the client and server are ordinary-user executables that last only for the life of the connection. One constraint to plan for: Mosh supports only UTF-8, though it fixes Unicode bugs found in other terminals and in SSH.
When to use it — and when not to
| Situation | Mosh fits | Plain SSH fits |
|---|---|---|
| Mobile or changing networks | Yes — session roams | No — connection drops |
| High-latency or lossy links | Yes — local echo, loss handling | Laggy typing |
| Laptop sleep/wake | Yes — connection resumes | Session usually lost |
| UDP blocked by firewall | No — needs UDP | Yes |
| Non-UTF-8 terminal environment | No | Yes |
| Minimal install, no extra software | No | Yes |
Getting started
The official site's "Getting Mosh" page is the entry point for installation on each supported platform. Before installing, confirm that UDP traffic is permitted between client and server and that your terminal uses UTF-8; both are prerequisites for a working session. After connecting, verify success by typing in a full-screen editor such as vim — instant echo with underlined predictions on a poor link is the expected behavior — then test roaming by switching networks and confirming the session survives.