Stay connected to a remote server while commuting or switching between Wi-Fi and mobile data, without the session ever dropping.
Work interactively on a high-latency VPN or slow connection with responsive typing because Mosh predicts keystrokes locally.
Replace SSH for daily remote development when you frequently close your laptop lid or change locations.
Requires installing the mosh server binary on the remote host and opening UDP ports 60000-61000 in the firewall.
Mosh is a remote terminal application, similar in purpose to SSH: it lets you connect to another computer over the internet and run commands on it. The key difference is how it handles unstable or changing network conditions. Where a standard SSH session drops the moment you lose your Wi-Fi or wake your laptop from sleep, Mosh keeps the session alive and picks up where you left off once connectivity returns. When you switch networks, such as moving from a coffee shop's Wi-Fi to your phone's cellular data, Mosh detects your new IP address automatically and continues the session without any manual reconnection. This roaming behavior is built into the protocol itself. Mosh also handles slow or high-latency connections better than SSH. It runs a local prediction model that guesses how each keystroke will appear on screen before the server confirms it, then immediately shows that prediction to you. The predicted characters are underlined until the server responds. For most typing and arrow-key navigation, the result is a terminal that feels responsive even when your connection is lagging. Full-screen applications like text editors and IRC clients work correctly with this system. Under the hood, Mosh uses SSH only to establish the initial connection and verify your identity. After that, the session moves to UDP, which lets it tolerate dropped packets and changing addresses. By default, it picks a port between 60000 and 61000. Your firewall needs to allow UDP traffic on that range for Mosh to function. There are some things Mosh does not do: it does not support X forwarding, port forwarding, or any of the non-interactive modes that SSH handles. It requires a UTF-8 terminal environment and needs its server binary installed on the remote host alongside the client binary on your machine.
← mobile-shell on gitmyhub — every repo by this author, as a profile.
Verify against the repo before relying on details.