patternMinor
Port forwarding for Windows Server like SSH port forwarding
Viewed 0 times
likeforwindowsforwardingserverportssh
Problem
I have a Windows server 2019 that have many VMs instances (running using HyperV). Each VMs has its own private IP and has some apps running inside and expose via ports.
It looks like:
-
VM1: running app nodejs port 3000, private ip: 10.10.10.1
-
VM2: running app php port 3001, private ip: 10.10.10.2
Now I want to setup a secure connection so my colleagues can access the apps inside each vm without expose them to internet, how can I achieve it?
If I have a Ubuntu Server and SSH I will use dynamic port forwarding like this article
https://www.digitalocean.com/community/tutorials/how-to-route-web-traffic-securely-without-a-vpn-using-a-socks-tunnel
Does Windows have something alternative?
I have did a lot of tutorials but it seem it does not work for me.
It looks like:
-
VM1: running app nodejs port 3000, private ip: 10.10.10.1
-
VM2: running app php port 3001, private ip: 10.10.10.2
Now I want to setup a secure connection so my colleagues can access the apps inside each vm without expose them to internet, how can I achieve it?
If I have a Ubuntu Server and SSH I will use dynamic port forwarding like this article
https://www.digitalocean.com/community/tutorials/how-to-route-web-traffic-securely-without-a-vpn-using-a-socks-tunnel
Does Windows have something alternative?
I have did a lot of tutorials but it seem it does not work for me.
Solution
You can use a ssh reverse proxy from any terminal (that has the ssh bin) to communicate with your applications.
For instance try this on the client side:
This command won't print anything (except prompting for ssh key's password) and won't stop by itself. To kill the reverse proxy you can do ctrl + C
Now you should be able to curl your application the following way on the client:
For instance try this on the client side:
ssh -NL 3000:localhost:3000 root@10.10.10.1This command won't print anything (except prompting for ssh key's password) and won't stop by itself. To kill the reverse proxy you can do ctrl + C
Now you should be able to curl your application the following way on the client:
curl 127.0.0.1:3000Code Snippets
ssh -NL 3000:localhost:3000 root@10.10.10.1curl 127.0.0.1:3000Context
StackExchange DevOps Q#11086, answer score: 1
Revisions (0)
No revisions yet.