Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

On Windows I use PuTTY to tunnel to my home server and tell Firefox to use PuTTY as a proxy. How would I accomplish something similar on my Mac?

share|improve this question
O SX? Shouldn't that be OS X? – TRiG May 1 '12 at 18:39
up vote 4 down vote accepted

MacOSX ssh client is based off OpenSSH.

ssh -D <port number>

You want the -D flag for dynamic application-level port forwarding.

From the man-page -

Specifies a local "dynamic" application-level port forwarding. This works by allocating a socket to listen to port on the local side, optionally bound to the specified bind_address. Whenever a connection is made to this port, the connection is forwarded over the secure channel, and the application protocol is then used to determine where to connect to from the remote machine. Currently the SOCKS4 and SOCKS5 protocols are supported, and ssh will act as a SOCKS server. Only root can forward privileged ports. Dynamic port forwardings can also be specified in the configuration file.

share|improve this answer

If you are looking to access just a single service, for example some web frontend use:

ssh -L <local port>:<host>:<remote port>

You can also put all this in your .ssh/config file, like this:

Host <nickname>
 HostName <>
 User <username>
 LocalForward <localport> <host>:<remoteport>

You can also specify multiple LocalForward lines if you have multiple servers/services to connect to, or use the dynamic application-level port forwarding as explained per Darren Hall.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.