Tuesday 17 April 2018

ssh tunnel - chrome socks proxy through ssh forwarding timeouts


I'm attempting to forward all traffic through from Google Chrome through a SSH tunnel.


When Firefox is configured to use the tunnel, it works. When chrome is launched with the proxy args appended, it quickly causes the ssh process to lock up and the pages timeout.


Client:



  • OpenSSH_5.8p1 Debian-7, OpenSSL 1.0.0d 8 Feb 2011

  • Google Chrome 17.0.963.79


Server:



  • OpenSSH_5.9p1 Debian-3ubuntu1, OpenSSL 1.0.0g 18 Jan 2012


Server config;


~$ cat /etc/ssh/sshd_config
...
PermitRootLogin no
AllowUsers testuser
ClientAliveInterval 60
ClientAliveCountMax 5
GatewayPorts yes
MaxSessions 100
#MaxStartups 100

Client connected using ~$ ssh -v -D 8118 testuser@example.net


Chrome executed with ~$ google-chrome --proxy-server="socks5://localhost:8118"


debug1: Connection to port 8118 forwarding to socks port 0 requested.
debug1: channel 3: new [dynamic-tcpip]
debug1: Connection to port 8118 forwarding to socks port 0 requested.
debug1: channel 4: new [dynamic-tcpip]
...
debug1: Connection to port 8118 forwarding to socks port 0 requested.
debug1: channel 51: new [dynamic-tcpip]
debug1: Connection to port 8118 forwarding to socks port 0 requested.
debug1: channel 52: new [dynamic-tcpip]

Pages loaded in chrome report; Error 7 (net::ERR_TIMED_OUT): The operation timed out.


The client side ssh process locks up and has to be killed.



Answer



I ended up fixing this by using Privoxy


I setup Privoxy on the ssh server (defaults to listen on 8118)


then connected to the server using; ssh user@example.net -L 8118:localhost:8118


Then set chrome to use localhost:8118 across all protocols


Note: after setting up privoxy, use http as the scheme in chrome/firefox


No comments:

Post a Comment

Where does Skype save my contact's avatars in Linux?

I'm using Skype on Linux. Where can I find images cached by skype of my contact's avatars? Answer I wanted to get those Skype avat...