Skip to content

Instantly share code, notes, and snippets.

@mwatts
Forked from chrisdiana/mosh-macos.md
Created February 13, 2022 01:36
Show Gist options
  • Save mwatts/c7b57f89b827e26df22b956e876dc313 to your computer and use it in GitHub Desktop.
Save mwatts/c7b57f89b827e26df22b956e876dc313 to your computer and use it in GitHub Desktop.
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

zsh

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

bash

$ 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