How to diagnose proxy over ssh


Recently I've tried to set up proxy using ssh -D 2454 username@servername (to browse the Internet through ssh tunnel), but failed to do this correctly. I would be happy for any suggestions and/or links to manuals, containing some useful information or hints on how to troubleshoot it.

Here is more detailed description of the problem

  1. I run ssh -D 2454 TheUser@TheServer (under user, not root). The command connects to TheServer and shows no warnings.
  2. In Mozilla Firefox under Edit>Preferences>Advanced>Connection Settings I choose the following settings:
    Manual proxy configuration, HTTP Proxy:, Port: 2454, SOCKS v5 (see the screenshot)

enter image description here

  1. Try to load a few pages. Firefox says "The connection to the server was reset while the page was loading".

However Firefox feels that I forwarded the port: if I skip step 1 it says "Firefox is configured to use a proxy server that is refusing connections".

Some technical details:

  1. Local computer ( is running Ubuntu 11.10.
  2. Remote computer (TheServer) is running Windows 7 with Cygwin.
  3. ssh connection does work (I can run commands on TheServer, rsync successfully downloads files from it)
  4. Proxy over ssh works just fine when I boot Windows and set it up with putty (with TheUser and TheServer unchanged).
  5. Mozilla Firefox works just fine without proxy.

Best Answer

The option -D is emulating the SOCKS proxy - thus I would rather remove the configuration from HTTP proxy fields and move it to the SOCKS proxy fields. I'm surprised it worked via putty.

Second thing, verify if the server can connect to the pages that you are trying to test. Try to establish a connection from the server somehow - lynx, links, or maybe firefox via VNC. If you don't have these, it would leave you with nc or telnet, which work as well but are harder to use.