Last active
November 22, 2023 15:46
-
-
Save chiro-hiro/694868279b419a12e27d86e068b2eac7 to your computer and use it in GitHub Desktop.
SSH Tunneling + SOCKS
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
#!/usr/bin/env bash | |
# (C) 2023 Chiro & Mary | |
echo "Turning IPv6 off..." | |
networksetup -setv6off "Wi-Fi" | |
echo "Checking proxy configuration..." | |
networksetup -getsocksfirewallproxy "Wi-Fi" | |
echo "Setting proxy configuration..." | |
networksetup -setsocksfirewallproxy "Wi-Fi" 127.0.0.1 31337 off | |
echo "Turning proxy on..." | |
networksetup -setsocksfirewallproxystate "Wi-Fi" on | |
echo "Checking proxy configuration..." | |
networksetup -getsocksfirewallproxy "Wi-Fi" | |
echo "Starting ssh tunnel..." | |
ssh -ND 127.0.0.1:31337 chiro@xx.xx.xx.xx | |
echo "Turning proxy off..." | |
networksetup -setsocksfirewallproxystate "Wi-Fi" off |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment