Why mosh is cool

Mosh is an SSH replacement I discovered after experiencing SSH input lag on my UK based server while I was located thousands of miles away.

According to its website, “[Mosh is] more robust and responsive, especially over Wi-Fi, cellular, and long-distance links.”. A short video I found on YouTube tests this statement. An explanation of how this works from the site: “This is accomplished using a new protocol called the State Synchronization Protocol, for which Mosh is the first application. SSP runs over UDP, synchronizing the state of any object from one host to another. Datagrams are encrypted and authenticated using AES-128 in OCB mode. While SSP takes care of the networking protocol, it is the implementation of the object being synchronized that defines the ultimate semantics of the protocol.”

Aside from this feature, Mosh also includes a roaming feature that will sustain the connection if your IP address changes, earning its namesake of mobile shell.

Installation

Mosh runs natively on all Linux/Unix systems and there are some handy scripts to get it running on cygwin.

Installation is simple with root privlages as mosh is included in most package managers. See here for more info. I had some trouble with the dependencies on my (non sudo) shared server. This gist script worked great for me.

Usage

Mosh is used in the same fashion as SSH. ie:

mosh yourserver.com

To specify a user:

mosh user@yourserver.com

To specify a port:

mosh -p 2222 yourserver.com

Give it a try!

Leave a Reply

wpDiscuz