Short version: use Mosh if you type a lot over slow or patchy connections and can open UDP ports on the computer. Use SSH if you need port forwarding, file transfer or agent forwarding, or if your address stays stable (Tailscale) and your work lives in tmux or Herdr. Either way, run a multiplexer.

What Mosh is

Mosh, the mobile shell, is a remote terminal built for connections that come and go. SSH carries a stream of bytes over TCP. Mosh instead runs its State Synchronization Protocol over UDP: both ends keep a snapshot of the screen, and the protocol's job is to bring the client up to the latest state. Three things follow from that design:

  • Roaming. The server replies to whatever address the last authentic packet came from, so moving from Wi-Fi to mobile data does not end the session.
  • Sleep and gaps. Put the device to sleep or lose signal, and the session resumes when the network returns. Mosh also tells you when it has not heard from the server for a while, where SSH just sits there.
  • Local echo. The client predicts what your keystrokes will do and shows them at once, underlining guesses the server has not yet confirmed. By default it only does this on slow links. In the authors' test over a 3G connection with about half a second of round-trip time, median keystroke response went from 503 ms with SSH to nearly instant.

How a Mosh connection starts

Mosh does not authenticate anyone itself. The mosh command logs in over SSH with your usual key or password, starts mosh-server as your user, and receives a UDP port number and an AES-128 session key back over that SSH connection. SSH then closes and the session continues over UDP. So you need:

  • Mosh on both ends. On the computer: brew install mosh (Mac) or sudo apt-get install mosh (Debian, Ubuntu).
  • SSH still working, on port 22 or wherever you run it.
  • UDP reachable. By default the server takes the first free port in the 60000 to 61000 range. If a firewall blocks it you get "Nothing received from the server on UDP port…".
mosh alex@macbook
mosh --ssh="ssh -p 2222" alex@macbook
mosh -p 60001 alex@macbook

The second form is for SSH on a non-standard port; the third pins the UDP port so you only have to open one. Over Tailscale there is nothing to forward on your router, since the default policy allows all traffic between your own devices, but a firewall on the computer itself still has to let that UDP in.

What Mosh does not do

  • Scrollback. Mosh synchronises only the visible screen. Its FAQ's answer is to run screen or tmux on the remote side.
  • Forwarding and file transfer. The man page says Mosh does not support X forwarding or the non-interactive uses of SSH, including port forwarding and sshfs. Keep using ssh, scp and sftp for those.
  • SSH agent forwarding. Not in the upstream release. The request was closed in 2018 with the maintainers declining the protocol change; patches exist only as open pull requests.
  • Re-attaching from another device. A Mosh session belongs to the client that started it. If that client is gone, a maintainer's answer is that the only option is to kill the server process. By default a stranded mosh-server waits indefinitely; set MOSH_SERVER_NETWORK_TMOUT to have it exit.
  • Anything but UTF-8. Mosh refuses to start without a UTF-8 locale on both sides.

Mosh vs SSH security

Login is SSH's job, so your keys, authorized_keys and server settings apply unchanged. After that, every Mosh datagram is encrypted and authenticated with AES-128 in OCB3 mode. Mosh runs no daemon and no code as root.

An attacker can end an SSH session with one forged TCP reset, which does not work against Mosh. On the other hand, as the project itself says, Mosh inherits any weakness in the SSH session that sets it up. Its record is clean: as of the 1.4.0 release, the developers say no security vulnerability had been reported in the previous decade, and the only issues listed are two denial-of-service bugs fixed in 2012.

Two things to weigh. Mosh needs a range of UDP ports open where SSH needs one TCP port. And releases are rare: 1.4.0 was announced on 31 October 2022 and is still the latest in October 2026; the one before it was 1.3.2 in July 2017. The repository is not abandoned (the newest commit we saw was from March 2026), but do not expect new features soon.

Side by side

SSHMosh
TransportTCPUDP, after an SSH login
Your IP address changesConnection is lostSession carries on
Phone sleeps or loses signalUsually a reconnectResumes by itself
Typing on a slow linkWaits for the server's replyInstant echo for most keys
ScrollbackYesVisible screen only
Port, X11 and agent forwardingYesNo
File transferscp, sftpNo
Needed on the computerAn SSH serverAn SSH server, mosh-server, open UDP ports

Mosh vs tmux

They solve different problems and are often used together. Mosh keeps the connection between your phone and the computer alive. tmux keeps the programs alive on the computer and lets any client attach to them, as the tmux guide describes. With Mosh alone, a client that gets killed can leave a session you cannot get back (Blink says its Mosh connections survive even a device reboot, so this varies by app), and you have no scrollback. With tmux alone, a dropped connection costs you a reconnect and tmux attach, and everything is where you left it. Mosh takes a command to run on arrival:

mosh alex@macbook -- tmux attach

That assumes a tmux session already exists. For how tmux compares with a multiplexer made for coding agents, see Herdr vs tmux.

When plain SSH is enough

Mosh fixes three things: address changes, gaps, and typing lag. The first two have other fixes.

Address changes. On a mesh VPN such as Tailscale, each device keeps the same 100.x.y.z address wherever it moves, and WireGuard, which Tailscale is built on, follows the phone to its new network. The SSH connection runs between those stable addresses, so it can survive a quick switch from Wi-Fi to mobile data. A long gap will still time out. Setup is in Tailscale SSH from your phone.

Gaps. If your work runs inside tmux or Herdr, a lost connection kills nothing. You reconnect and re-attach. A client that reconnects by itself makes this close to invisible.

Typing lag is where SSH has no answer. On a train or with one bar of signal, Mosh is noticeably nicer to type in, and nothing above changes that.

Melta uses plain SSH, not Mosh. That is workable because sessions live in Herdr on the computer and the app reconnects on its own after a drop, then shows the same panes. It does not give you Mosh's instant echo on a bad link.

Phone apps that support Mosh

Confirmed on their own pages in October 2026: Blink Shell (iPhone, iPad), Termius (its free Starter plan includes Mosh), Prompt 3 (iPhone, iPad) and Moshi (iOS and Android). On Android, Termux packages Mosh 1.4.0. mosh.org also lists JuiceSSH, but its Google Play page returned "not found" when we checked on 2 October 2026.

Common questions

Is Mosh any good? Yes, for interactive typing over poor connections, which is what it was designed for. It is mature and slow-moving, with its last release in 2022.

Mosh or SSH? Mosh for a terminal on a flaky link. SSH for forwarding, file transfer, or when you cannot open UDP ports. You need SSH installed either way.

Do I need tmux with Mosh? For scrollback, or to pick up a session from another device, yes.

How do I use Mosh? Install it on both ends, allow UDP 60000 to 61000 on the computer, then run mosh user@host in place of ssh user@host.

Sources