Mosh (software)
In computing, Mosh (mobile shell) is a tool used to connect from a client computer to a server over the Internet, to run a remote terminal. Mosh is similar to SSH, with additional features meant to improve usability for mobile users. The major features are: * Mosh maintains its session even when it "roams" (when the client endpoint changes to different IP addresses), for example by moving to a different Wi-Fi network or when changing from Wi-Fi to 3G. * Mosh maintains the terminal session (not "connection" in the TCP-sense because Mosh uses UDP) even when a user loses their Internet connection or puts their client to "sleep". In comparison, SSH can lose its connection in such cases because TCP times out. * A Mosh client attempts to be responsive to keyboard events (typing, erasing characters with the key, and so on) without waiting for network lag. It uses an adaptive system that predicts whether the application running on the server will decide to echo the user's keystrokes or deletions. The main drawbacks of Mosh are additional prerequisites to the server, that it lacks some special features of SSH (such as connection forwarding) and the lack of a native Windows client. An alternative for Linux servers (that still require installation on the server) is to use GNU Screen on top of a regular SSH connection.
In computing, Mosh (mobile shell) is a tool used to connect from a client computer to a server over the Internet, to run a remote terminal. Mosh is similar to SSH, with additional features meant to improve usability for mobile users. The major features are: Mosh maintains its session even when it "roams" (when the client endpoint changes to different IP addresses), for example by moving to a different Wi-Fi network or when changing from Wi-Fi to 3G. Mosh maintains the terminal session (not "connection" in the TCP-sense because Mosh uses UDP) even when a user loses their Internet connection or puts their client to "sleep". In comparison, SSH can lose its connection in such cases because TCP times out. A Mosh client attempts to be responsive to keyboard events (typing, erasing characters with the key, and so on) without waiting for network lag. It uses an adaptive system that predicts whether the application running on the server will decide to echo the user's keystrokes or deletions. The main drawbacks of Mosh are additional prerequisites to the server, that it lacks some special features of SSH (such as connection forwarding) and the lack of a native Windows client. An alternative for Linux servers (that still require installation on the server) is to use GNU Screen on top of a regular SSH connection. ==Design== Mosh works at a different layer from SSH. Whereas SSH transmits a stream of bytes in each direction (from server to client or client to server) using TCP, Mosh runs a terminal emulator at the server to figure out what should be on the screen. The server then transmits this screen to the client at a varying frame rate, depending on the speed of the network. This allows Mosh to save on network traffic on slow or intermittent connections. ==Supported platforms== Mosh is available for most Linux distributions, macOS, FreeBSD, NetBSD, and OpenBSD, Android, Solaris, Cygwin, and as a Chrome App. The iOS program Termius includes an independent implementation of the Mosh protocol. ==Performance== ==Drawbacks== Compared to the more popular SSH, Mosh has the following drawbacks: ===Prerequisites on the server=== The major drawback of Mosh is that it requires the server to fulfill additional prerequisites which are not needed by ssh itself. Due to its design, Mosh needs the server to allow direct connections via UDP. Servers not fulfilling these prerequisites cannot be used by Mosh. Examples of such systems include servers behind firewalls which restrict connections to the ssh-port via TCP. Also problematic are servers which are only indirectly reachable. The latter is usually accommodated by ssh via the 'ProxyCommand' option, but this is not supported by Mosh. ===One port per connection=== By default, the server tries to allocate the first free UDP port in the range 60001–61000, per connection. This dynamic port allocation is considered an extra burden and risk for firewall maintenance. A significant part of the firewall-filtering happens through connection tracking, so called stateful filtering, this is based on the SYN/ACK flags in TCP segments, UDP packets don't have such flags. Mitigation: The UDP port on the server can be set per Mosh connection, so that only a limited number of ports need to be opened Deep packet inspection firewalls and application firewalls can handle this better by looking at content of the packet and associate it to the initial connection ===Output drops and lack of terminal scrollback=== Scrollback is not supported in the current release of Mosh, and when using it in a terminal emulator with scrollbars they disappear, but is planned for the 1.3 release. This functionality is a trade-off for garbage cleaning, as binary output is wiped away . One way to mitigate this is by using Mosh in combination with a terminal multiplexer like screen or tmux. ===Lack of ssh-agent forwarding=== ssh-agent forwarding is not currently supported. ===Lack of X11 forwarding=== X11 forwarding is not yet supported. ==References==
References
No reference rows published for this article.
Cite this article
MLA
"Mosh (software)." encyclopegia.org, 2025, https://encyclopegia.org/wiki/mosh-software. Accessed 25 November 2026.
Chicago
"Mosh (software)." encyclopegia.org. Accessed November 25, 2026. https://encyclopegia.org/wiki/mosh-software.
APA
encyclopegia.org. (2025). Mosh (software). Retrieved November 25, 2026, from https://encyclopegia.org/wiki/mosh-software
Accessed November 25, 2026 · CC BY-SA 4.0 · citation page · JSON