Operating Systems : Ssh through a proxy from your Apple Mac OS X

This page last changed on Jun 15, 2010 by Kees de Kooter

For Linux using Corkscrew and for Windows using Putty it is possible to punch through proxies to connect to a remote SSH-server. Let's do the exact same thing from an Apple, using Mac OS X.

You will need to download Corkscrew. Open a Terminal to type some of these commands:

$ cd Downloads
$ tar -xvzf corkscrew-x.y.tar.gz
$ cd corkscrew-x-y
$ ./configure --host=apple
$ make
$ cp corkscrew $HOME/.ssh/

If that does not work; try downloading my compiled version (right click -download linked file), maybe that works on your mac.

Now you need to tell your ssh client (also on your Apple) to use corkscrew. In that same terminal, either use vi(1) or simple copy-change-paste these commands to suit your situation:

echo "Host machine-on-the-outside-network.example.com" >> $HOME/.ssh/config
echo "ProxyCommand $HOME/.ssh/corkscrew proxy.on-the-inside-network.example.com 8080 %h %p" >> $HOME/.ssh/config

Replace machine-on-the-outside-network.example.com by the machine that you want to reach, mostly a server, or your home-computer running an ssh daemond. Replace proxy.on-the-inside-network.example.com by the name of the proxy server you are using. You can find this at the Network preference in Advanced at Proxies. Replace 8080 by the port your proxy is listening to, mostly 8080 or 3128.

You are now done, in that terminal that is or was open, type:

$ ssh machine-on-the-outside-network.example.com

and you should be done!

Credits: http://meinit.nl/ssh-through-a-proxy-from-your-apple-mac-os-x