I have a vm running ubuntu. I use that vm by connecting to it via SSH. My problem begins with some policy enforcement that blocks all incoming traffic coming from the internet.
The vm can make outbound connections with no limitations, however there can be no port opened to the internet for incoming connections.
Assuming I can execute scripts on the vm, I wonder if it's possible to make it connect to my IP, using some port, and by that establish an SSH session.
What I imagine is this:
vm:
- tries to establish a connection on port 6543 to my constant IP address 1.1.1.1.
- keeps retrying until the connection is established
- once the connection is established, keep that connection open.
my laptop:
- run some daemon to listen on port 6543 and wait for a such connection from the vm
- once the connection is established, listen on some port locally, say 8022 ssh to localhost:8022 and get an SSH session established to my vm
My knowledge of networking tells me it's feasible. However, I am not sure how to implement that, and furthermore if there's already a utility for that.