Accessing SSH on networks powered through squid might be tricky if you’re new to tunneling etc. I was blocked by Squid from sshing to remote machines and making changes to squid config as well as iptables rules didn’t do any magic.
Corkscrew helped me recently to allow ssh access through HTTP-Proxy.
tar -xzvf corkscrew.tar.gz # [..] cd corkscrew ./configure 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 configuration file 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 http-proxy.example.com 8080 %h %p
Replacing http-proxy.example.com 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.