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?
MORE INFO:
The output of netstat -aon
says:
tcp 0 0 ::1:3333 :::* LISTEN off (0.00/0/0)
tcp 0 0 :::587 :::* LISTEN off (0.00/0/0)
tcp 0 0 :::465 :::* LISTEN off (0.00/0/0)
tcp 0 0 :::21 :::* LISTEN off (0.00/0/0)
tcp 0 0 :::22 :::* LISTEN off (0.00/0/0)
tcp 0 0 :::25 :::* LISTEN off (0.00/0/0)
chrome --proxy-server="socks5://192.168.0.5:3333"
added- another to try iscurl --socks5 192.168.0.5:3333 http://blah
(curlis on gnuwin32 or cygwin) Worth trying with 127.0.0.1 toonetstat
. Apparently the problem is that it's listening only to localhost and not everyone??*:3333
so I supposessh -D *:3333
then it should be open to more than just local host to connect to it. (if that was your problem then that might help) But also why not just try connecting from localhost to localhost.