What you see
One of these messages, in place of the session:
mosh-server is not installed on this server. Install the mosh package there (for example: sudo apt install mosh), or turn Mosh off for this server
mosh-server needs a UTF-8 locale on the server (for example en_US.UTF-8 or C.UTF-8)
mosh-server did not start: ...
could not reach 203.0.113.10 over UDP: ...
When the server uses a proxy: Mosh cannot go through a proxy. Turn off Mosh or the proxy for this server.
During a session, a bar can say No contact with the server for 12 s. Mosh keeps trying.
Why it happens
Mosh signs in over SSH, starts mosh-server on the server, then talks to it over UDP. Each step needs something on the server: the program, a UTF-8 locale, and an open UDP port.
What to do
- Install Mosh on the server. On Debian or Ubuntu:
On Fedora or Rocky Linux:sudo apt install moshsudo dnf install mosh - Give the server a UTF-8 locale:
locale -a | grep -i utf sudo locale-gen en_US.UTF-8 - Open the UDP ports Mosh uses, on the server and in your provider's firewall:
sudo ufw allow 60000:61000/udp - If
mosh-serveris installed in a folder that is not on the path, write its full path in the server's mosh-server command, for example/usr/local/bin/mosh-server. - If the bar about no contact stays, the network blocks UDP. Try another network, or turn Mosh off for that server and use SSH.
The same start by hand, from a computer with Mosh:
mosh --ssh="ssh -p 22" deploy@203.0.113.10
More in Mosh.