1

I need to access (SSH) my client's server (Ubuntu Server 18.04) to provide support. But the server in client location is situated in private network.

I could have connected with port forwarding in client's router but even they got private IP from ISP. So if I want to connect to the server I need to arrange port forwarding in both client's router and their ISP's router or I need to ask my client to buy a public IP.

Is there any solution to overcome this situation (installing a software/package in server, using reverse proxy server, using something like reverse tcp payload etc) so that they don't have to buy public IP or port forward at ISP's router?

Please note that I have public IP, so it is possible to directly reach my PC from the server. Below file is a image containing visual representation of client's network.

https://file.io/1DIu2I

Any help would be really appreciated.

1
  • The proper solution for this is to get a public IP on the machine you need to reach. With IPv6 there will be enough IP addresses to remove all need for NAT.
    – kasperd
    Nov 16, 2018 at 13:18

1 Answer 1

1

What you need is Reverse SSH, a term used to create a secure tunnel from server A to your machine B. Note that this connection has to be initiated from the server A. Basically something like:

ssh -R 3011:localhost:22 user@B

B is your machine in case. Since you mentioned that you have a public IP, the server can access your machine. Once the authentication is successful, there will be a secure tunnel through which you can ssh back into the server A.

ssh -p 3011 user@localhost

By first look, it might seem that you are accessing your own machine (localhost) but you actually are accessing the server A through the tunnel created in first step. You can read more about this at: https://blog.devolutions.net/2017/3/what-is-reverse-ssh-port-forwarding which also mentions some additional flags which are not necessary, but good to know in some cases.

PS. The link to gofile.io is not accessible

4
  • Thanks for the answer. Indeed this is very helpful. Tons of thanks! PS: I've edited the image link. Nov 14, 2018 at 1:58
  • If the answer is correct, would you mind accepting it for others to trust in the answer. And also, that link is still not valid, gives 403 error, fyi
    – sla3k
    Nov 14, 2018 at 17:46
  • Apologies. Image link is updated again. I'm new to this platform so I don't have any idea on how to accept the answer. Would you mind guiding me on that please? Nov 16, 2018 at 11:08
  • @TamalBiswas look here: meta.stackexchange.com/questions/5234/… Nov 16, 2018 at 14:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.