Ubuntu – ssh as socks proxy – channel 5: open failed: connect failed: Connection refused

networkingPROXYssh

I experience difficulty using ssh as socks proxy.

Some details…
I connect to remote host using yakuake

ssh user@remote.host.domain -D5902

also I use 127.0.0.1:5902 as my socks v5 proxy in browser.

Everything works fine, but after some time I begin to receive errors in yakuake:

channel 57: open failed: connect failed: Connection refused
channel 12: open failed: connect failed: Connection refused
channel 13: open failed: connect failed: Connection refused
channel 5: open failed: connect failed: Connection refused
channel 13: open failed: connect failed: Connection refused
channel 5: open failed: connect failed: Connection refused
channel 10: open failed: connect failed: Connection refused
channel 6: open failed: connect failed: Connection refused
channel 5: open failed: connect failed: Connection refused
channel 5: open failed: connect failed: Connection refused
channel 9: open failed: connect failed: Connection refused
channel 22: open failed: connect failed: Connection refused
channel 5: open failed: connect failed: Connection refused
channel 9: open failed: connect failed: Connection refused
channel 15: open failed: connect failed: Connection refused
channel 16: open failed: connect failed: Connection refused
channel 9: open failed: connect failed: Connection refused
channel 29: open failed: connect failed: Connection refused
channel 16: open failed: connect failed: Connection refused

In the same time, I experience slow work in browser.

Then I break session in yakuake and start new one, it helps for some time, then the situation repeats again.

Remote host:

Ubuntu 14.04.3 LTS (GNU/Linux 2.6.32-042stab111.12 x86_64)

Local host:

$ lsb_release -aNo LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 14.04.3 LTS
Release: 14.04
Codename: trusty

Any help on how to solve it without breaking session? I would rather set sime bigger timeout (if it is possible at all) instead to receive these errors.

Best Answer

I can't speak to your specific errors, but the reason you're seeing them is because your browser is trying to make connections that your SSH server will not allow. The SOCKS5 proxy I'm using is throwing tons of errors because I have 13,000+ entries in my /etc/hosts file to resolve ad servers as 0.0.0.0, and every time it tries to load an ad, an error is thrown, as 0.0.0.0 refuses the connection. I find it quite satisfying actually.

Related Question