Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Suppose I have the following situation: ServerA hosts a website that is accessible only from other computers on its local LAN (ie there is a firewall preventing any access from IP addresses outside the LAN) ServerB is a computer that has a backdoor that allows me to securely login via the command line (like an SSH shell) ServerC is a computer with a fixed public IP address that I won (my "cloud server") HomePC is my home computer, sitting behind my home router firewall

My ultimate objective is to be able to open my browser on home PC and connect to the website on ServerA (the server that is accessible only by other computers on the same LAN as serverA).

I know that one way to do this is as follows: 1) Do a command line SSH into ServerB so I can issue some shell commands to set up my SSH tunnels. 2) Create an SSH tunnel on serverB such that any traffic to port 1234 on ServerB gets forwarded to port 80 on ServerA. Probably do something similar for HTTPS port 443. 3) Create a reverse SSH tunnel from port 1234 on ServerB to port 5678 on serverC.

If understand correctly, this means that any traffic that gets sent to port 5678 on serverC will be forwarded to port 1234 on ServerB, which in turn forwards that traffic to port 80 on serverA which is the web server on serverA. Any response from serverA gets sent back in the other direction and ends up at port 5678 on serverC.

The problem with this is that ANYONE who connects to port 5678 on serverC will then have access to the web traffic coming from serverA. This is obviously a security issue.

So is there any way of restricting access to port 5678 on serverC to just my homePC? Are there any ways of somehow restricting access to this tunnel?

share|improve this question

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.