Mosh keeps the session when the network drops

A remote shell that survives sleep, dead zones, and the switch from Wi-Fi to cellular. SwiftServer starts it for you over SSH.

Download on the App StoreDownload on the Mac App Store

Lock the phone. Come back later.

Close the lid or change networks, and the shell is still there when you return: same directory, same program running.

  • Keystrokes appear instantly, underlined until the server confirms them.

Details

Started over SSH

Set a machine to Mosh. SwiftServer signs in over SSH, then moves the session to UDP.

Per machine

Set the server path and UDP ports per machine. Diagnostics show where a start stopped.

Through a bastion or proxy

The SSH start can go through a jump route or a connection proxy.

Free

Save as many machines and open as many sessions as you like.

Getting a Mosh session running

  1. 01

    Install mosh on the server

    apt install mosh, dnf install mosh, or your package manager’s equivalent. SwiftServer needs mosh-server to be present; it does not install it.

  2. 02

    Open the UDP ports

    Allow inbound UDP 60000 to 61000 on the server firewall, or narrow the range and set the same range in SwiftServer.

  3. 03

    Set the terminal mode

    In the machine’s settings, under Terminal, set Connection to Mosh.

  4. 04

    Connect

    Start the terminal the way you always do. SwiftServer signs in over SSH, then hands the session to Mosh.

  5. 05

    Walk away

    Lock the phone, change networks, and come back. The session picks up where it was.

Mosh docs

Questions

What is Mosh?

Mosh, short for mobile shell, is a remote terminal protocol. It starts through SSH, then runs over UDP with its own state synchronization, so the session survives IP address changes, sleep, and packet loss that would end an SSH connection.

Do I need to install anything for Mosh?

On the server, yes: mosh-server, which comes with the mosh package in every major distribution. On your device, no. SwiftServer implements the client side itself.

Which ports does Mosh use?

UDP in the 60000 to 61000 range by default, one port per session. The range is configurable per machine, and the initial bootstrap runs over your normal SSH port.

Is Mosh free in SwiftServer?

Yes. Mosh is part of the free tier, with no limit on machines or open sessions.

Can I use Mosh through a jump host?

Yes, for the SSH bootstrap, over a jump host route or a SOCKS5 or HTTP CONNECT proxy. The UDP session itself connects directly, so the machine also needs an address your device can reach; if that differs, set a UDP host for it.

What if the Mosh session will not start?

Mosh Diagnostics shows where the bootstrap stopped. The usual causes are mosh-server missing from the path, the UDP range blocked by a firewall, or a NAT that will not hold the mapping.

Close the lid. The session waits.

Free on iPhone, iPad, and Mac.

Download on the App StoreDownload on the Mac App Store