Ubuntu – ssh tunnel error : channel 3: open failed: connect failed: Connection refused

PROXYsshssh-tunnelUbuntu

I'm trying to access and browse internet through a ssh server so in my laptop (ubuntu 12.04) I do this:

ssh -D 9999 root@server-ip

then in the network proxy in my laptop I set:

HTTP proxy 127.0.0.1      port 9999

but when I try to open a page in my browser it doesn't connect and in my terminal I get errors like these :

channel 4: open failed: connect failed: Connection refused
channel 3: open failed: connect failed: Connection refused
channel 5: open failed: connect failed: Connection refused
channel 4: open failed: connect failed: Connection refused
channel 6: open failed: connect failed: Connection refused

I'm new to this and found this method on the internet so I'm don't know what I'm doing wrong. I'd really appreciate it if anyone can help me make this work.

Best Answer

The -D option does not creates an HTTP proxy. It creates a SOCKS5 proxy:

 -D [bind_address:]port
         Specifies a local “dynamic” application-level port forwarding....Currently the SOCKS4 and SOCKS5 protocols are sup‐
         ported, and ssh will act as a SOCKS server.

In order to use the proxy you will need to configure Firefox to use a SOCKS5 proxy as described in this document.

Related Question