I have been trying to connect to the Web through an ssh tunnel but without success...

Mi test is pretty simple : I've got two computers behind my router(with the internet access).

  • Computer 1 : (ssh client)
  • computer 2 : (ssh server)

computer 1 : runs ssh -v -ND 2080 pi@

socks tunnel opens with verbose result :

debug1: Authentication succeeded (password).
debug1: Local connections to LOCALHOST:2080 forwarded to remote address socks:0
debug1: Local forwarding listening on ::1 port 2080.
debug1: channel 0: new [port listener]
debug1: Local forwarding listening on port 2080.
debug1: channel 1: new [port listener]
debug1: Requesting no-more-sessions@openssh.com
debug1: Entering interactive session.

I try the tunnel with firefox configured with :

"Manual proxy configuration" HTTP Proxy :; port : 2080; SOCKSv5

Then I try to surf the web
The browser fails to retrieve web content and displays :

 - The site could be temporarily unavailable or too busy. Try again in a few
 - If you are unable to load any pages, check your computer's network
 - If your computer or network is protected by a firewall or proxy, make sure
    that Firefox is permitted to access the Web.

On every web request the verbose ssh tunnel prints to stdout :

debug1: Connection to port 2080 forwarding to socks port 0 requested.
debug1: channel 2: new [dynamic-tcpip]
debug1: channel 2: free: dynamic-tcpip, nchannels 3

Is SSH supposed to forward the requests to the web or am I supposed to install some kind of proxy on coñputer 2 e.g. SQUID ?

Thanks a lot for helping me with this issue :)

  • 1
    To answer the last question, no, you should not need a "second" proxy like Squid, SSH is all that should be required. – davidgo Mar 6 '13 at 19:25
  • Thanks @davidgo for your rapid reply. I deduce my computer2 (ssh server) is misconfigured. Do you kwow if a fresh ssh-server install needs some additionnal tweaking to manage web-proxying ? – Dom Mar 6 '13 at 22:21
  • I can't see that being the case (at least I've never come across it, and I've managed servers through and with SSH for as long as I can recall). Its unlikely your ssh server is misconfigured - more likely a problem with your browser. I know when I had need to do something similar recently I could not get it to work with Firefox, I landed up using Google Chrome and specifying the proxy info on the command line (I use Linux, so Chrome did not support doing it in the GUI). Maybe you could do a TCPDump while trying to get the page and see what is happening with SSH traffic to provide a clue ? – davidgo Mar 7 '13 at 0:32
  • @davidgo I finally got it working ! :) You were right it was a browser problem ! I launched 'chromium-browser --proxy-server=socks5://localhost:2080' on computer 1 and 'sudo tcpdump -i eth0 -nvv port 8' on computer 2 and it worked ! My failure was in the conf of firefox I found help here : superuser.com/questions/417397/… Thanks for guiding me to the solution ! – Dom Mar 8 '13 at 18:02

Resolved My failure was in the conf of firefox good configuration can be found here : How to tunnel HTTP over SSH via SOCKS?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.