0

for simplicity ill give my servers name, server-A, server-B

  • server-A - a simple server with public IP, this server is 1G ram, shared CPU
  • server-B - a more robust server with more ram, cpu cores etc..., but it does not have public IP, it goes through a router that I have no access to, so I cant do port forwarding for that server

I want to run a service on server-B so people will be able to connect to it, and the heavy calculations of that service will run on server-B

because I cant do port forwarding to server-B I am wondering if there is any network service that I can do something like reverse shell, server-B will be the one to initiate the connection to server-A and create a tunnel, then server-A will forward traffic to the tunnel initiated by server-B

at the end, people will connect to server-A on some port (8080 for example), server-A will take that request and forward it to server-B with a tunnel they share

is it possible

note they are not in the same LAN, they are in completely different locations, server-B can reach directly to server-A with the internet, but server-A cant reach server-B directly

4
  • server-A has network access to server-B? Commented Mar 9, 2022 at 10:29
  • no, server-B can reach server-A, but not the otherway around, they are not in the same LAN or anything like that Commented Mar 9, 2022 at 10:32
  • can you do ssh to server-A from server-B? Commented Mar 9, 2022 at 10:41
  • yes, server-B can ssh to server-A Commented Mar 9, 2022 at 10:42

1 Answer 1

0

you can do SSH remote port forwading if enabled on server-A.

Run this command on server-B

ssh -R Server-A-port:127.0.0.1:server-B-port -N -f user@Server-A

So now any request hit on server-A:Server-A-port it will be passed to server-B:server-B-port

you can read more about ssh forwading here.

1
  • thanks, ill check it tomorrow Commented Mar 9, 2022 at 10:56

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.