6

freeSSHd was set up on the server. Putty successfully connecting to server over SSH. I have tried to configure tunneling for SOCKS5 and HTTP but it failed to work. Especially was tested on Opera where proxy was set to 127.0.0.1 and port 1080.

I am trying to set up SOCKS5 proxy/tunneling in putty that way: Connection>SSH>Tunnels there I set:

Source port 1080

Destination 127.0.0.1

Dynamic

IPv4

Why SOCKS5 proxy tunneling is not working?


UPDATE:

Firefox writes "The proxy server is refusing connections"


UPDATE2:

Set up all the same but left blank Destination.

Firefox messages:

The connection was reset

The connection to the server was reset while the page was loading.

    The site could be temporarily unavailable or too busy. Try again in a few moments.
    If you are unable to load any pages, check your computer's network connection.
    If your computer or network is protected by a firewall or proxy, make sure that Firefox is permitted to access the Web.

UPDATE 3

Firefox refuses to connect to google.com with error : The connection was reset. Opera is not working. (it appeased to work when it reseted proxy config)


UPDATE 4

How putty deals with network connections? In this cmd at some times there was TCP 127.0.0.1:1080 LISTENING. What are the rest 2 TCP connections with 1080 port? CLIENT CMD:  CLIENT


UPDATE 5:

freeSSHd config on server:

enter image description here


UPDATE 6:

I made Deluge torrent client successfully function over SSH tunnel (using SOCKS5)! Internet browsers still being stubborn and not connecting to web (neither SOCKS5 or HTTP proxy settings is working).

9
  • Did you try without destination? Any particular error message?
    – bonob
    Apr 17, 2014 at 11:30
  • Regarding update 3: if Opera works, the tunnel is working then, which is good news. You're using Firefox standard proxy configuration? You put 127.0.0.1:1080 as SOCKS5 proxy, nothing for the other proxy types?
    – bonob
    Apr 17, 2014 at 11:50
  • The ssh connection itself is working? (You can interact with the server?) What is the freeSSHd configuration?
    – bonob
    Apr 17, 2014 at 12:06
  • SSH to server works fine. I can interact with the server.
    – J.Olufsen
    Apr 17, 2014 at 12:13
  • When putty starts (with all ssh tunnel configuration) it is not opening any 1080 ports on localhost. I must do it in order to set up tunnel. Right?
    – J.Olufsen
    Apr 17, 2014 at 12:20

1 Answer 1

6

Assuming you mean to access an external SOCKS proxy from windows, here you go. If you meant setting up a SSH server in windows, cygwin can do this with sshd.

In windows, cygwin makes this easy, but if you don't have cygwin already, here are PuTTY instructions.


Set it up like this:
replace port 2222 with 22 or whatever your port for SSH is. Leaving it blank should work too. 22 is the default, but I had it on a non-standard port. Replace 127.0.0.1 here with your actual address.

Setting up puTTY - 1

Here, LEAVE the 127.0.0.1 where it is. It is SUPPOSED to be there. You can change 8080 to whatever port you want the SOCKS proxy on.
Setting up puTTY - 2

Be sure to set the login username to whatever yours is. Mine is 'mobile' on my iphone, which I was using when i made this example for the apple stack exchange. Setting up puTTY - 3

If you want, you can then save a profile for this, to avoid setting it all back up each time you have a problem. This is done in the 'session' section at the very top.

Linux/Unix/BSD/Solaris/OSX/HP-UX/whatever I'm still missing

You can run ssh -D 8080 user@address

Now, you need to open your web browser of choice; I use firefox, so I will use it as an example. I have used chrome and opera, but as I do not like them and do not currently have them installed, I cannot presently use it for an example. But you set it up as a SOCKS proxy, regardless of browser.

These screenshots were done with a forwarded X11, so the fonts are ugly, but pay it no mind.
First, go to the preferences window (tools -> options or edit -> preferences, depending on OS). Then, go to Advanced -> Network -> Settings.... Firefox Configuration 1

Use the following configuration for the browser.
Firefox Configuration 2

Problems and Solutions

Problem:

My app doesn't allow setting a SOCKS proxy.

Solution:

I have had this problem with games like Minecraft. Here's some fixes.
For minecraft, I added a argument to ssh. I regularly play on the nerd.nu reddit minecraft servers (reddit.com/r/mcpublic). Since minecraft 1.6, SSH tunneling and SOCKS proxies set as command line arguments haven't worked. You used to be able to add java parameters -DSocksProxyHost=127.0.0.1 -DSocksProxyPort=8080 and it would work. Now, however, the solution isn't quite as nice, but it does work.

When you start ssh, instead of ssh -D 8080 user@address, do
ssh -D 8080 -L 127.0.0.1:25565:p.nerd.nu:25565 user@address.
Then, when you want to connect to the server, instead add the URL 127.0.0.1:25565 to your list of servers! The remote server will appear on 127.0.0.1/localhost thanks to the miracle of SSH tunneling!

For other programs/games, the same rule applies. If you can't set a SOCKS proxy and nothing else works, just add -L 127.0.0.1:<port>:<remote URL to access>:<remote port>.

There is nothing forcing you to use the same port on 127.0.0.1 that you would normally, so I could have, for example, mapped p.nerd.nu:25565 to 127.0.0.1:1025 and the game wouldn't care as long as I specified the port. Not all programs are so lenient, but it's useful to remember.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .