Page 1 of 1

How To use a server as proxy

Posted: 2015-06-26 05:05
by scubindu
Hello everybody.

I want to use a server I have as a SOCKS proxy for browsing from my laptop.
According to OpenSSH's man page, you can do that with the opcion -D

-D port
Specifies a local ``dynamic'' application-level port forwarding. This works by allocating a socket to listen to port on the local side, and whenever a connection is made to this port, the connection is forwarded over the secure channel, and the application protocol is then used to determine where to connect to from the remote machine. Currently the SOCKS4 and SOCKS5 protocols are supported, and ssh will act as a SOCKS server. Only root can forward privileged ports. Dynamic port forwardings can also be specified in the configuration file.
So in my server (IP 192.168.0.5) I typed the command:
ssh localhost -D3333
(an SSH connection to itself)

That should make it listen on port 3333.
Then I configured my browser to use the SOCKS proxy 192.168.0.5:3333

However it doesn't seem to work, the browser says it couldn't establish the connection.

What am I doing wrong?
Can this be done with OpenSSH?

Re: How To use a server as proxy

Posted: 2015-06-26 06:29
by botg
By default the dynamic port listens on localhost only, otherwise it would be an open proxy. There should be an option to change the binding. However: Do not run open proxies unless you can deal with the legal consequences.