Add Me!Close Menu Navigation

My technical corner about Linux, Perl, programming, computer networks and network security

Add Me!Open Categories Menu

Remote technical support by VNC through SSH Tunnel

I suppose that you are an advanced linux user. And those skills make you really happy. But, sometimes we have a big problem: our friends may want to have Linux on their computers. There are many reasons why. Probably Linux looks like pretty for those people. The main point is: they are (usually) novice users. They will need your help in the future probably. Your friends – your problems. No mercy. ;-)

 

But I have found small solution for this problem for 5 years. The solution is of course SSH tunel for VNC protocol. The computer of your friend establish automatically connection to your machine and create the tunnel for you. This conception works over NAT networks (either you and your friend network).

 

You need the following things:

  • Linux on computers (your and your friend) – of course on Windows this is also possible, but my script works on the Linux-based systems
  • the AutoSSH and  on the client computer (your friend)
  • the OpenSSH on the client (if you want to establish a ssh connection) and on the server computer (your)
  • Public key based authentication – on the server computer, for security reasons you need to create a new user on your server computer
  • x11vnc server on the client computer – for security reasons it should listen only on the loopback interface (mostly 127.0.0.1)
  • and of course – a vnc client on the server computer for connect to the the client (krdc, vncviewer, vinagre, etc)

 

The script contains:

  • auto_tunnel_ssh.sh – to establish the tunnel for ordinary ssh connection for emergency (optional component)
  • auto_tunnel_vnc.sh – to establish the tunnel for the VNC connections
  • auto_vnc.sh – to run the vnc service (if it doesn’t work)
  • remote_helpdesk.sh – main script which launches the others. It’s runs by the crontab.

 

How it works:

  1. The remote_helpdesk.sh on the client computer script runs the other scripts (auto_tunnel_vnc.sh, auto_vnc.sh and if you want auto_tunnel_ssh.sh too). This script should be add to the crontab.
  2. The scripts auto_tunnel_ssh.sh and auto_tunnel_vnc.sh establish connection to the server computer and create the tunnels for the VNC service and the SSH service
  3. The script auto_vnc.sh on the client machine checks whether the VNC service is works and lauchnes it, if not.
  4. The server computer has the OpenSSH service which allows the public key based authentication (the key without password is need for auto_tunnel_vnc.sh and auto_tunnel_ssh.sh)

 

You have to read the comments in the scripts to configuration before use it!

DOWNLOAD: The VNC throught ssh tunnel script

 

Leave a Reply

You must be logged in to post a comment.