I am trying to get a remote access approach (open source) working involving openssh and tightvnc that deals with NAT, that allows someone to remote to my server and then allows me to vnc back to their machine w/o having to mess with their firewall and allows me to use a static WAN address down the road. I've been trying to rough this out in small steps to manage the unknowns (for me, a lot:). It would appear others have gotten this to work, but am stumped.
For starters, have have gotten passwordless reverse ssh working between two windows 10 virtual machines (hyperv) on my laptop (i.e., I'm not trying to deal with port forwarding on my firewall or the static WAN address yet) but can't get the vcn to work over the reverse ssh tunnel, though it works just using the lan IP address instead of "localhost" for the reverse ssh.
I am wondering if my overall approach is flawed or not. It is:
Machine A/Person A (wants help)
currently a win10 vm
ssh client (native on win10)
Machine B/Person B (help desk role)
currently win10 vm (same LAN as machine A at present)
ssh server (optional win10 add on)
The idea would be Person A on machine A starts the VNC server on machine A, and connects over reverse ssh to machine B (so far so good). At that point person B on Machine B could VNC back to machine A and help.
My assumption which may be the problem is to use reverse ssh from A->B (I've tried the -L option too instead of -R), and then use tightvnc to access machine A back from B. After starting the vnc server on machine A, an example of the initial ssh command I've gotten to work from A to B is:
ssh -R 5902:localhost:5901 user@lanaddressMachineB -i ~/.ssh/id_rsa -vv
This part works. The vnc server on A has port 5902 (I have turned loopback on and off, tried listening server). I'm hoping this is something like I'm confused about which is the local host or something like that.
The error I'm getting on Machine B trying to vnc back to machine A over the ssh tunnel using "localhost::5902" is "connection has been gracefully closed". The vnc connection works if I just use the lanip of the vnc server on A from B.
There is nothing in the "tviewer.log" on either the client or the server. I've tried changing some settings in sshd_config (e.g., AllowAgentForwarding yes) with no result.
Q is my design flawed or workable? Is it the way I'm configuring things and can be addressed, possibly using a different ssh command?
Q do I need ssh server on both machines (am hoping to avoid this as means have to install it on other people's machines)?
I know there are various paid for and some free options to all of this, but am hoping to get it going.