Created
December 10, 2024 23:36
-
-
Save peyton/89cfee8e76b4ef56f066037ca0c2e7ba to your computer and use it in GitHub Desktop.
Allow mosh-server through macOS firewall
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
fix_mosh_server() { | |
local fw='/usr/libexec/ApplicationFirewall/socketfilterfw' | |
local mosh_sym="$(which mosh-server)" | |
local mosh_abs="$(readlink -f $mosh_sym)" | |
sudo "$fw" --setglobalstate off | |
sudo "$fw" --add "$mosh_sym" | |
sudo "$fw" --unblockapp "$mosh_sym" | |
sudo "$fw" --add "$mosh_abs" | |
sudo "$fw" --unblockapp "$mosh_abs" | |
sudo "$fw" --setglobalstate on | |
} | |
fix_mosh_server |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment