Reaching out to others! Free & Open Source Software, Kannada, L10n, L18n Data Science, Cloud Computing & more…

Accessing on networks powered through might be tricky if you’re new to tunneling etc. I was blocked by from sshing to remote machines and making changes to config as well as rules didn’t do any magic.

helped me recently to allow ssh access through HTTP-Proxy.

All that I had to do is to get Corkscrew from its homepage. Install it the way as follows.
Unpack and Compile corkscrew:

tar -xzvf corkscrew.tar.gz
# [..]
cd corkscrew
make install

You’re too good till here if everything goes fine. Lets see how we can use Corkscrew on SSH.

Suggest SSH command to use proxy by adding the following line to ssh that you find in your home directory. Mostly located in $HOME/.ssh/config. If you don’t find one, create it. Couple of lines marked below should go inside the config file.

Host *
  ProxyCommand corkscrew 8080 %h %p

Replacing with the name or address of your http proxy and possibly replacing 8080 with the port on which the proxy listens, which may be 80 or 3128 in case of squid. The %h and %p will be replaced automatically by SSH with the actual destination host and port.

These lines tell the SSH client to start corkscrew to make the actual connection to the SSH server. The Host * line says that this will be done for ALL hosts.

That is it. Now try to ssh to remote machines and see a thumbs up by your terminal prompt.

Many time this trick even works to when you want to browse your networks securely by tunneling over your remote machine for browsers.

Interesting site explaining more about Corkscrew can be found here.

Tags: , , , , ,