I want to replace TeamViewer with a FOSS solution. I need to support some remote computers. I have a working SSH tunnel set up between two computers using a middleman server like this:
Kubuntu_laptop--->nat_fw--->Debian_Server<--nat_fw<--Kubuntu_desktop
This SSH tunnel is working now.
Next I want to connect to the desktop on "Kubuntu_desktop" from "Kubuntu_laptop" using the SSH tunnel.
Regarding the connection for this leg:
Debian_Server<--nat_fw<--Kubuntu_desktop
Here is how it is established:
autossh -M 5234 -N -f -R 1234:localhost:22 user@mydebian.com -p 22
I cannot change the existing monitoring port (5234) or the remote (- R) port number (1234 in this example). Can vnc tunnel over this existing SSH connection? UPDATE: the answer is no
; I need to set up a new SSH tunnel for use with vnc as described here.
Regarding the connection for this leg:
Kubuntu_laptop--->nat_fw--->Debian_Server
I can use any SSH parameters required.
I cannot open up any ports on the routers/firewalls.
x11vnc server was recommended to me, so I'm testing with that. It is running on the desktop and listening on port 5900. However, I did not use any command line options when starting x11vnc, so it probably isn't configured correctly yet.
Will vnc work over this existing SSH connection? Notice that there are no ports 5900 defined. And note that I cannot change the port number for the -R option as I mentioned above.
I have a lot of questions about how to get this working, but one is whether vnc can listen on the existing port (-R 1234 in the example above). And if so, can I still ssh into that box as I do now?
Here's what I tried so far:
On remote desktop (where x11vnc server is installed):
tester@Kubuntu_desktop:~> autossh -M 5234 -i ~/.ssh/my_id_rsa -fNR 1234:localhost:5901 user@mydebian.com
make sure x11vnc server is running on port 5901:
tester@Kubuntu_desktop:~> x11vnc -autoport 5901
On my laptop:
sudo ssh -NL 5901:localhost:1234 -i ~/.ssh/admin_id_rsa admin@mydebian.com
connect local vnc client to localhost port 5901
Open KRDC in Kubuntu_laptop and connect to (vnc)
localhost:5901
I'm getting a failed connection - server not found
.