Running into this error message when trying to run a mosh server on macOS Catalina? The steps below should solve the problem which is most likely either a $PATH and/or firewall issues.
command not found: mosh-server
Connection to X.X.X.X closed.
/usr/local/bin/mosh: Did not find mosh server startup message. (Have you installed mosh on your server?)
$ brew install mosh
zsh
$ echo "export PATH=$PATH:/usr/local/bin" >> ~/.zshenv
bash
$ echo "export PATH=$PATH:/usr/local/bin" >> ~/.bashrc
# Turn the firewall off
$ sudo /usr/libexec/ApplicationFirewall/socketfilterfw --setglobalstate off
# Enable the firewall rules (make sure you are using your actual path)
$ sudo /usr/libexec/ApplicationFirewall/socketfilterfw --add /usr/local/bin/mosh-server
# Unblock the app
$ sudo /usr/libexec/ApplicationFirewall/socketfilterfw --unblockapp /usr/local/bin/mosh-server
# Turn the firewall back on
$ sudo /usr/libexec/ApplicationFirewall/socketfilterfw --setglobalstate on
$ mosh [email protected]
Just got mosh-server running on a Mac via SSH using this little snippet. Thanks!