Christopher Bottoms
Christopher Bottoms

Reputation: 11158

How can I set up SSH tunneling to access a webserver behind a firewall?

How would I access a webserver behind a firewall? I'm developing an application for this webserver which is not yet open to the public.

Someone walked me through this before, so I know it can be done. However, it has been about four months and I haven't been able to do it again.

I'm using Putty to connect to the remote machine. From that machine I can open the site http://dev.server.address:83 using Firefox. However, I want to be able to open http://localhost:80 on my machine to see the same page.

I'm using the server address and port 83 for the "source port" I'm using localhost:80 for the "destination port"

Upvotes: 3

Views: 9087

Answers (4)

The Finn
The Finn

Reputation: 1

On Linux you can also make it happen with:

$ ssh -f -R 83:localhost:80 [email protected]

Provided that you have an SSH account named "user".

Upvotes: 0

intgr
intgr

Reputation: 20466

You need to enter "80" into Source port and dev.server.address:83 to Destination.

[And don't forget to click the "Add" button before you leave the configuration screen. If you don't click that, PuTTY doesn't actually create a tunnel. I fell for that gotcha quite a few times myself]

Upvotes: 4

Anand Shah
Anand Shah

Reputation: 14913

Do you have a webserver running on your local machine? If that is listening on port 80 http://localhost:80 wont work. Alternatively try mapping the source to a different port (12345 for eg.) and then try http://localhost:12345 in your browser.

Upvotes: 1

Reynolds
Reynolds

Reputation: 414

Have you tried using 127.0.0.1:80 instead of localhost:80? I don't use PuTTY, but when I use SSH on my machine, I have to specify 127.0.0.1 instead of localhost.

Upvotes: 2

Related Questions