ssh over a proxy

Using ssh over a proxy can be made very simple when using putty on a Windows platform, but I always had to do very complicated stuff when trying this from cygwin and faced impossibilities from my FreeBSD boxes.

Now I found something nifty (that doesn’t mean that it didn’t exist, but I never searched for it), called corkscrew .

This tool is installed in your ssh_config (or your local config in ~/.ssh), like this:

# cat ~/.ssh/config

Host *  ProxyCommand corkscrew your.proxy.server 8080 %h %p

This line tells ssh to start corkscrew to connect to “your.proxy.server” on port 8080 (although this could be anything). I did this for all hosts (hence the “Host *”), but it can be configured for hosts indivually.

%h and %p are  parameters for host and port, send to the host you’re trying to access.

When configured correctly, a ‘ssh yourhost’ will connect through the proxy server to your host.

This entry was posted on Monday, September 3rd, 2007 at 12:21 pm and is filed under tips. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

Leave a Reply

Spam Protection by WP-SpamFree