Mosh: the Mobile Shell
Website: mosh.org GitHub: keithw/mosh License: GPLv2+ Author: Keith Winstein (MIT)
Remote terminal application that allows roaming, supports intermittent connectivity, and provides intelligent local echo and line editing.
Mosh is a replacement for interactive SSH terminals. More robust and responsive, especially over Wi-Fi, cellular, and long-distance links.
Key Features
- Change IP. Stay connected. — Mosh automatically roams as you move between Internet connections (Wi-Fi → Ethernet → LTE). Most network programs lose connections after roaming, including SSH. Mosh is different.
- Makes for sweet dreams — Put your laptop to sleep and wake it up later with your connection intact. If connection drops, Mosh warns you but resumes when network service returns.
- Get rid of network lag — SSH waits for server reply before showing your typing. Mosh gives instant response to typing, deleting, and line editing — adaptively, even in full-screen programs (emacs, vim). Outstanding predictions are underlined so you won’t be misled.
- No privileged code. No daemon. — No root/superuser needed to install or run. Client and server are ordinary user executables that last only for the life of the connection.
- Same login method — Mosh doesn’t listen on network ports or authenticate users. Client logs in via SSH with the same credentials (password, public key). Then Mosh runs
mosh-serverremotely and connects over UDP. - Runs inside your terminal — Works with xterm, gnome-terminal, urxvt, Terminal.app, iTerm, emacs, screen, tmux. Supports UTF-8, fixes Unicode bugs in other terminals and SSH.
- Control-C works great — UDP-based protocol handles packet loss gracefully. Doesn’t fill network buffers, so Ctrl+C always works to halt a runaway process.
Available Platforms
- GNU/Linux
- BSD
- macOS
- Solaris
- Android
- Chrome
- iOS
Getting It
# macOS
brew install mosh
# Ubuntu/Debian
sudo apt install mosh
# Fedora
sudo dnf install mosh
# Arch
sudo pacman -S moshUsage
# Connect to a server
mosh user@server.com
# With custom SSH port
mosh --ssh="ssh -p 2222" user@server.com