Created
June 23, 2017 16:36
-
-
Save mgax/0f4657a773e029775651aee7311037aa to your computer and use it in GitHub Desktop.
Open a SOCKS proxy on the remote host
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 | |
set -e | |
SOCKSTUNNELHOST="$1" | |
function sockstunnel_off() { | |
sudo networksetup -setsocksfirewallproxystate Wi-Fi off | |
} | |
trap sockstunnel_off EXIT | |
set -x | |
sudo networksetup -setsocksfirewallproxy Wi-Fi 127.0.0.1 31878 | |
sudo networksetup -setsocksfirewallproxystate Wi-Fi on | |
ssh "$SOCKSTUNNELHOST" -D 31878 -N |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment