Archives for : October2017

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

socks_on

and stop it with

socks_off

 

😉