Poor man’s VPN using SSH and SOCKS proxy for MacOS

Add the following aliases to your .bash_profile:

alias socks_on='networksetup -setsocksfirewallproxystate Wi-Fi on; ssh -D 8666 -C -N -f -M -S ~/.socks.socket <youruser>@<your_office_gateway>'
alias socks_off='networksetup -setsocksfirewallproxystate Wi-Fi off; ssh -S ~/.socks.socket -O exit <youruser>@<your_office_gateway>'

Later you can start your tunnel with command


and stop it with




Share me: Facebooktwittergoogle_plusredditmailby feather
Follow me: Facebooktwittergoogle_plusby feather