Skip to content

Instantly share code, notes, and snippets.

@chrisdiana
Last active July 21, 2026 07:12
Show Gist options
  • Select an option

  • Save chrisdiana/e2e471f4451f5fa16c3b9ef28037c57a to your computer and use it in GitHub Desktop.

Select an option

Save chrisdiana/e2e471f4451f5fa16c3b9ef28037c57a 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
@1d10t

1d10t commented Mar 19, 2026

Copy link
Copy Markdown
brew install mosh
MOSH_BIN=$(which mosh-server)
MOSH_BINDIR=$(dirname $MOSH_BIN)
echo "export PATH=$PATH:$MOSH_BINDIR" >> ~/.zshenv
sudo /usr/libexec/ApplicationFirewall/socketfilterfw --setglobalstate off
sudo /usr/libexec/ApplicationFirewall/socketfilterfw --add $MOSH_BIN
sudo /usr/libexec/ApplicationFirewall/socketfilterfw --unblockapp $MOSH_BIN
sudo /usr/libexec/ApplicationFirewall/socketfilterfw --setglobalstate on

@mostalive

Copy link
Copy Markdown

Thanks @1d10t , that helped me get to mosh on my mac from my ipad :-).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment