Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Getting mosh server running on macOS Catalina

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?)

1. Install Mosh

$ brew install mosh

2. Update path to include mosh-server


$ echo "export PATH=$PATH:/usr/local/bin" >> ~/.zshenv


$ echo "export PATH=$PATH:/usr/local/bin" >> ~/.bashrc

3. Update the firewall

# 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

4. Now try connecting using the mosh client

$ mosh user@X.X.X.X
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment