Ubuntu – What’s the best way to secure a Teamviewer/X11/VNC connection

vnc

I'm fairly new to Ubuntu so please bear with me. I use Teamviewer on my Windows machines and love it, even more so that there is an Ubuntu version. As most will know it can't start on computer startup as a service on Ubuntu so if my machine reboots for any reason I'm screwed.

Obviously I don't want to enable port 5900 to the outside world as even with a secure password VNC access is hackable.

So, I have installed, configured and successfully tested OpenVPN which means I can "see" my machine but I'm wondering what would be the best solution for remote controlling it if it at the login page with no user logged in.

VNC? X11(although I'm sketchy as to what exactly this is). Any help would be appreciated.

Thanks

Paul.

Best Answer

ssh + fail2ban + x11vnc == win.

You basically (and I'm noting the irony in using that work, knowing how complicated what I'm about to write sounds) run a SSH server. Use fail2ban to stop people brute forcing it. Put it on a non-standard port for bonus points. Then from Windows (Putty, a SSH client) you connect to Ubuntu forwarding the Ubuntu's local VNC traffic over the SSH connection to a Windows-local port. Then Putty tell's Ubuntu to run x11vnc. And finally on Windows you connect to VNC using localhost:5900 which is now (magically) the Ubuntu's localhost:5900.

I wrote a step-by-step for another user. It's really not as stressful as it looks and it can be scripted so, once set up, it all happens with a double-click at the Windows end.