← Back to archive

Repo of the Day

mobile-shell/mosh: Mobile Shell

Published: Aug 30, 2026

Open repository ↗

Mobile Shell

Summary

Mosh is a remote terminal application written in C++ that provides an SSH-style interactive session resilient to network changes. It runs over UDP after an initial SSH handshake and uses predictive local echo so typing stays responsive on high-latency or intermittent links. The project is released under the GPL-3.0 license.

What it is useful for

Mosh is useful when engineers need to stay connected to remote servers over unstable networks: a laptop that switches between Wi-Fi, wired Ethernet, and cellular data, a machine that suspends and resumes, or a link with significant packet loss. The session stays alive across IP changes, the client recovers from prediction errors within a round trip, and pending keystrokes are underlined while awaiting server confirmation. It is designed to work correctly with full-screen programs like vi, emacs, tmux, alpine, and irssi, and it warns the user when the server has been silent for a while. The README is explicit about scope: Mosh does not support X forwarding and does not cover non-interactive SSH uses such as port forwarding, and it requires a UTF-8 environment.

How engineers can use it

The mosh-client binary must exist on the local machine and mosh-server on the remote host. The basic invocation documented in the README is:

$ mosh [user@]host

If the binaries are outside $PATH, --client=PATH and --server=PATH select alternate locations. Mosh uses a UDP port in the 60000–61000 range by default, overridable with -p; this does not change the port used by the initial SSH connection. UDP must be allowed between client and server. mosh-client receives an AES-128 session key through an environment variable, so the host OS must prevent other users from reading a process's environment; the README confirms this is the case on GNU/Linux, macOS, and FreeBSD.

For contributors, the README documents a build on Debian, Fedora, and macOS using protobuf, OpenSSL, ncurses, and zlib, followed by ./autogen.sh, ./configure, make, and make check. Optional coverage reports use lcov after ./configure --enable-code-coverage. Distributors are advised to pass --enable-compile-warnings=error because the code is security-sensitive. Prebuilt package instructions and additional options are not in the README and are delegated to the mosh.org site.