Wednesday, 25 August 2010

Mac - ssh through a proxy

Ever needed to ssh through a proxy and didn't have putty handy/accessible/ported to your environment? Have no fear coz some smart cookie has written corkscrew which works hand in hand with the openssl ssh client to make all your tunnelling dreams come true.

http://www.agroman.net/corkscrew

Simply download, compile and install it (no seriously this has the easiest make process in the world - it's a credit to the developer) to say /usr/local/bin and then set up your ssh config file (in ~/.ssh/config) to look like this:

ProxyCommand /usr/local/bin/corkscrew host-for-your-proxy.foo.bar 8080 %h %p

And if you need to authenticate, add the path the a file containing the credentials like so:

ProxyCommand /usr/local/bin/corkscrew host-for-your-proxy.foo.bar 8080 %h %p ~/.ssh/proxy.auth

The auth file simply needs the following string:
username:password

Probably a good idea to chmod 600 your auth file

Easy.

No comments: