Mosh: SSH for the 21st Century

Mosh is an SSH replacement, providing persistent shell connectivity. For power users, Mosh brings several advantages to the table against the incumbent SSH.

The Basics

  1. Persistent sessions. If the connection you are using drops, Mosh will save the history & state of the shell for you. When you reconnect it will all be there. So, changing WiFi access points, switching to lan, or to a 4g tethered connection, your session will pick up where you left off, automatically.

  2. With SSH, over high latency connections most users can type faster than the prompt. This is because an SSH shell will not show a character until the client has received confirmation from the server. In extreme latency cases this means dropped characters. With Mosh, the experience is the same as typing in your own shell. If the connection has high latency, Mosh will temporarily prevent the command from being executed until the typed line is confirmed.

  3. Process Halting. With Mosh you can always hit Control-C to halt a runaway process, when SSH would be too busy looping over the runaway process.

  4. Open source [ Github], available on Linux, OSX, Android, and jailbroken iOS.

Installation

Linux
1
apt-get install mosh
OSX via HomeBrew
1
brew install mobile-shell

Usage

1
2
3
$ mosh 192.168.1.1 # Basic connection
$ mosh user@192.168.1.1 # Connecting w/user
$ mosh user@host-name # including Avahi (favorite for RPI access over lan)

Video