Last active
November 4, 2020 10:21
-
-
Save luong-komorebi/834209c731a4bdb3f98748402556419f to your computer and use it in GitHub Desktop.
Make mosh work for os x (bypass os x firewall)
This file contains 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
fix_mosh_server() { | |
local fw='/usr/libexec/ApplicationFirewall/socketfilterfw' | |
local mosh_sym="$(which mosh-server)" | |
local mosh_abs="$(greadlink -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 | |
} |
This file contains 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
# i recommend setting up the following alias first | |
alias firepower='sudo /usr/libexec/ApplicationFirewall/socketfilterfw' | |
# temporarily shut firewall off | |
firepower --setglobalstate off | |
# add symlinked location to firewall | |
firepower --add $(which mosh-server) | |
firepower --unblockapp $(which mosh-server) | |
# add homebrew location to firewall | |
firepower --add $(brew --prefix)/Cellar/mosh/1.3.2_2/bin/mosh-server | |
firepower --unblockapp $(brew --prefix)/Cellar/mosh/1.3.2_2/bin/mosh-server | |
# re-enable firewall | |
firepower --setglobalstate on |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment