Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

In OSX Lion I set ssh proxy to connect to work. All I do is

a) in terminal

ssh -D 8080 -f -C -q -N work_host_machine

b) System prefereces, proxy, set socks proxy

Step b) needs to be performed by hand, but can it be set and unset through shell or script?

share|improve this question
up vote 1 down vote accepted

Something like this:

sudo networksetup -setsocksfirewallproxy Ethernet 127.0.0.1 8080 off

...assuming your primary network service is named "Ethernet". If you need to figure out the service name, it gets a bit more complicated; see this code snippet for one way to do it.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .