Access website only reachable from specific server

2

I have a website that can only be accessed from a specific server. I can ssh to that server, open e.g. Firefox and access the website. This is very slow due to the X-forwarding. Can I set up a tunnel on my local browser to access this website?

pfnuesel

Posted 2017-07-07T12:07:42.970

Reputation: 260

Answers

3

Sure can.

MachineA is where you are sitting, MachineB is the server you can SSH to and that can connect to the webserver, MachineC is the webserver.

ssh -L8080:machinec:80 user@machineb

Then you can connect to http://localhost:8080 and you should be looking at the website.

IF the website is configured for name based virtual hosts, has a SSL cert, etc. you can use that name in your own /etc/hosts and point it to localhost.

IF the webserver you want to connect to is using HTTPS then you need to change the :80 to :443 and connect to https://localhost:8080 instead.

ivanivan

Posted 2017-07-07T12:07:42.970

Reputation: 2 634