Quote:
Originally Posted by true_atlantis
i am using putty, but i cannot get it to work... here is how i have it set up...
source port: 80
destination: localhost:8999
|
You have it backwards.
For SOURCE PORT, put 8999
For DESTINATION, put 192.168.1.1:80
The SOURCE PORT, according to Putty, is the port on your client that you will be connecting to. Thus you would point the web browser on your client to
http://localhost:8999 for this example. Your client computer is connecting to ITSELF, thus the "localhost" in the URL.
The DESTINATION is where the connection will ultimately end up. In this example, your router. Thus you specify your router's IP address and port in the DESTINATION field. Note that the IP address in the DESTINATION does not have to be accessible from the client computer. It needs to be accessible from the ssh server computer. That's the whole point in what we're trying to do here. Your client computer cannot contact your router directly, but your ssh server can, so we set up a tunnel from the client to the router via the ssh server.
I'll try to draw what's happening as viewed from your client computer:
localhost:8999 ---> ssh_server_ip_address:22 ---> 192.168.1.1:80
Your client computer's web browser thinks its talking to port 8999 on its own local self (actually, it IS). But ssh is encrypting the data, sending it to your ssh server, then unencrypting it, and finally sending it on to 192.168.1.1:80. Note that it's entirely possible that your client computer can also talk to something at 192.168.1.1, but it's a totally different thing than the 192.168.1.1 that your ssh_server can talk to. The DESTINATION is specified relative to your ssh_server, not your client.
Now if THAT wasn't confusing, I don't know what is!!!
[edit]
Sorry, I forgot the other part of your question before posting last time.
In Putty, fill in your SOURCE PORT and your DESTINATION. Leave everything else at it's default. Then click the ADD button. You may also want to go back to the "Session" area of the config and click SAVE so that your port forwarding comes up automatically next time as well.
[/edit]