Mosh "Did not find mosh server startup message"
What the Mosh error "Did not find mosh server startup message" means, how Mosh starts the server over SSH, and the causes that stop the server from starting.
mosh: Did not find mosh server startup message. (Have you installed mosh on your server?)
This is an error from the mosh command on a computer. It means SSH login worked, but what the host printed did not include the one line that tells Mosh where to connect. The lines above the error are usually the real reason.
How Mosh starts
The mosh command does three things:
- It logs in with SSH and runs
mosh-server newon the host. The host picks a free UDP port and makes a one-time key. mosh-serverprints a line of the formMOSH CONNECTfollowed by a UDP port number and a session key, and the SSH session ends.- The client reads that line and then talks to the server over UDP. SSH is not used again.
The client prints every other line the host sends back. If no MOSH CONNECT line arrives before the SSH session ends, it stops with the message above.
So the problem is on the host side, before UDP. Opening firewall ports will not fix it. For a connection that gets as far as UDP, see Mosh "Nothing received from server on UDP port".
Causes, from the line printed above the error
mosh-server: command not found: Mosh is not installed on the host, or its program is not in the path of the login SSH uses to run it. Install themoshpackage, or give the full location withmosh --server=/path/to/mosh-server host. The Mosh FAQ says it is often not in the default login path on BSD servers, or whenmosh-serveris installed in your home directory.mosh-server needs a UTF-8 native locale to run.: The host's locale is not UTF-8. The message lists the locale variables it found. Set a UTF-8 locale, for example in the host's shell startup file.- Nothing at all:
mosh-serverdid not print its line: the login ended early, or the server crashed at start. Tryssh host mosh-server newyourself and read the output. - A different error or a login banner only: Whatever ran in place of
mosh-server. Fix that first.
The Mosh FAQ also lists a crash of mosh-server at start-up on systems with glibc 2.22, worked around in Mosh 1.2.6 and later. Updating Mosh on the host fixes that case.
Quick test from a computer
ssh [email protected] mosh-server new
A working server prints a line like MOSH CONNECT 60001 followed by a 22-character key and returns to your prompt. A mosh-server process stays on the host for that test. Find and end it as described in A detached Mosh session.