Basically I want to be able to do something like teamviewer, where regardless of what the network configuration is, as long as both my ssh server (Machine A) and ssh client (Machine B) have internet access (and some 3rd server, Machine C), I can gain access - the reason for this is I want to be able to move machine A around, plug it in to power, have it auto-connect to one of several pre-configured wifi networks (each one unique/different), without having configured port-forwarding or similar on the networks, and be able to log into it via the internet from Machine B
How can I accomplish this? I don't mind setting something up on a server with a static IP address for helping out with the handshake, but I also don't mind a 3rd party server either if something already exists (like it does for say teamviewer)
edit for clarity: I have 3 machines, A B and C
A is a headless raspberry pi that will be powered on/off in random locations, connect to a pre-confiugred wifi network
B is the machine with a proper monitor, keyboard, etc. that I want to connect from
C is a rented AWS server that I have with a static IP address, can reliably SSH in from B, and can install whatever is necessary to help B connect to A
ssh
tunnels, very briefly. I could never get them to stay up, though, even withautossh
; if the uplink dropped for any reason, they'd always have to be restarted by hand. Eventually I set up a small VPN for myself with OpenVPN, and it's done the job nicely.