Linux – How to use SSH over a proxy in Linux

bashlinuxPROXYssh

I'm trying to use SSH from a bash shell (Ubuntu 11.10) to connect to my home university via a proxy at work.

When I use PuTTY in Windows from the same place, I can put in the proxy details in the proxy tab and it works. However, I can't get it to work from Ubuntu.

I configured Ubuntu to use the proxy system-wide with the network-proxy dialog in the system settings. However, SSH doesn't work – either it can't resolve the hostname or the connection just times out.

What am I doing wrong?

I can browse the internet (also HTTPS sites), and can also update my packages, but I cannot use SSH, FTP or anything else.

The proxy settings I'm using for PuTTY and in the network-proxy settings are:

proxy-name:8888 (same for all protocols)

To be honest, I don't know what kind of proxy that is.

Best Answer

I think it is likely the proxy implementation in putty does a CONNECT through the proxy server. Not many proxies are configured to accept this type of connection, as it means that the proxy can be used to piggyback any type of connection, whereas normally a proxy server is deployed to control what is allowed out of the perimeter.

If this is the case, then I expect that corkscrew is what you are after. This makes the initial connection to the proxy and initiates the CONNECT. You then push the ssh connection over this "tunnel".

There is a description of how you can do it here. It is likely that corkscrew is in the repository of your distribution, so try that first before downloading.

Related Question