Quick encrypt for your coffee shop traffic.

Just a little function to add to your .profile that automatically turns on a socks proxy and tunnels all your traffic through the server of your choice. It’s a simple setup and <CTRL>-C kills the connection and shuts off the proxy. This assumes that you have shell access to some server that you trust to run your traffic through.

I recommend setting up public key authentication for ease of use.

# warm feet
function socks() { 
  networksetup -setsocksfirewallproxy AirPort localhost 9999
  ssh -ND 9999 -C username@domain
  networksetup -setsocksfirewallproxystate AirPort off
}

(One caveat: If you happen to close the window of your terminal without hitting <CTRL>-C first, it will not disable the socks proxy.)

Tags: , , ,

2 Responses to “Quick encrypt for your coffee shop traffic.”

  1. Bermi Says:

    Nice script.

    You should have a look at Sidestep http://chetansurpur.com/projects/sidestep/. It enables socks transparently when the wifi is not encrypted.

  2. Jason Mooberry Says:

    Nice! I might recommend that to a few friends. :)

Leave a Reply