Created
January 9, 2018 11:45
-
-
Save svenvarkel/bc28f9de660a4d41e7c2b06c7caf1bbf to your computer and use it in GitHub Desktop.
Poor man's SOCKS proxy via SSH. Add the following lines to your ~/.bash_profile and then socks_on / socks_off
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
alias socks_on="ssh -D 8666 -C -N -f -M -S ~/.socks.socket $USER@<your_office_gateway>; networksetup -setsocksfirewallproxystate Wi-Fi on;" | |
alias socks_off="networksetup -setsocksfirewallproxystate Wi-Fi off; ssh -S ~/.socks.socket -O exit $USER@<your_office_gateway>;" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add these 2 lines to your ~/.bash_profile. Replace <your_office_gateway> with a real gateway name or IP-address. Create new shell and run socks_off when out of office. Don't forget to run socks_off when back to office.