Strovent SystemsSign in
Reference

Mosh or SSH?

A short comparison to decide which to use for a connection.

Both give you a shell. They fail differently.

                           SSH            Mosh
Survives IP change         no             yes
Survives sleep, drops      session ends   session resumes
Typing on a slow link      lags           instant (local echo)
Port forwarding            yes            no
Agent forwarding           yes            no
Through a jump host        yes            no
Needs                      TCP 22         UDP range + mosh-server
Scrollback                 yes (client)   screen only (use tmux)

Pick Mosh when

  • You work from a phone or tablet and move between networks.
  • The connection is slow or drops now and then.
  • You mostly type commands, edit and read output.

Pick SSH when

Together

Many people connect with Mosh and run tmux inside it. Mosh keeps the connection alive. tmux keeps the work: if the Mosh session ends, the programs keep running on the host and you reattach.

Spotted a mistake? Email [email protected].