SSH is the industry standard for managing servers, but on mobile it drops every time you switch between Wi-Fi and mobile data or lock your screen. Mosh keeps your session alive across network changes and renders your typing instantly, even with high latency. It doesn't replace SSH: it uses it for login, then communicates over UDP.

What SSH is and what Mosh adds

SSH establishes an encrypted TCP connection with the server. If your mobile IP changes, that connection drops and you have to log in again. Mosh (mobile shell) first logs in via SSH, launches mosh-server on the server, and routes the session over UDP from then on. This enables three key features:

  1. Roaming: The session survives network and IP changes.
  2. Predictive local echo: Keystrokes appear immediately and are corrected if the server's response differs.
  3. Reconnection after sleep: When you unlock your phone, your session picks up right where you left it.
SSHMosh
TransportTCPUDP (logs in via SSH)
Switching between Wi-Fi and mobile dataDisconnectsStays connected
Ports22/TCP (or your custom port)22/TCP to log in + UDP 60000-61000
Port forwarding and X11YesNo
Terminal reflow on window resizeYesNo (mosh-server does not support it)

Sources: mosh.org and man mosh, verified on October 18, 2026.

When NOT to use Mosh

  • If you need tunnels or port forwarding: Mosh does not support them.
  • If your firewall or network blocks UDP 60000-61000. You can specify a single port using -p, but it still needs to be open.
  • If the server doesn't have mosh-server and you can't install it (sudo apt install mosh on Debian/Ubuntu, brew install mosh on macOS).

How to use Mosh in termi1

termi1 integrates the official mosh-client on iPhone, iPad, and Android—it is not a reimplementation. In the connection settings, SSH is the default mode and Mosh is a toggle. You can also paste the MOSH CONNECT … line printed by mosh-server. If the server doesn't have Mosh, the session continues over SSH and the app notifies you, rather than failing silently. Sessions run inside tmux, so whatever you leave running will still be there when you return.

If your server is your Mac, there is termi1 Companion, a free menu bar app (macOS 14 or later). It can be downloaded from termi1.com as an Apple-signed and notarized DMG; it is not on the Mac App Store. It does three things:

  • It verifies that Remote Login, mosh-server, and tmux are active. If Mosh is missing, it opens Terminal with brew install mosh pre-typed, but won't run it without your confirmation.
  • It pairs your iPhone or iPad using a six-digit code: your device sends its public key, which is saved to ~/.ssh/authorized_keys, with no copying or pasting required.
  • If enabled (disabled by default), it sends a notification on your Mac when a long-running process in tmux finishes.

Frequently asked questions

Does Mosh replace SSH?

No. Mosh uses SSH to authenticate and launch mosh-server on the remote machine. The session then shifts to UDP, but your SSH keys and configuration remain the same. You cannot use Mosh without SSH access to the server.

What ports do I need to open for Mosh?

Your SSH port (typically 22/TCP) for initial login and UDP ports 60000–61000 for the session. If you don't want to open the entire range, specify a single port using the -p flag and open only that port in your firewall.

Can Mosh be used for tunneling or port forwarding?

No. Mosh does not support port forwarding or X11 forwarding. If you need a tunnel to a database or a web dashboard, establish a standard SSH connection for that and use Mosh for your interactive terminal session.

What happens in termi1 if the server doesn't have Mosh installed?

The connection falls back to SSH, and termi1 alerts you that mosh-server was not found. You can install it using sudo apt install mosh (Debian/Ubuntu) or brew install mosh (macOS) and re-enable the toggle.