Home Research Personal activity Linux & Security Link

 Using SSH to connect VNC Viewer on Windows to Linux Server

1. First, go to http://www.realvnc.com/ to download VNC viewer for windows and VNC server for Linux.

2. Install VNC server in your Linux server, which is called "Bob". RPM package of VNC is very easy to install. Install VNC viewer on your Windows computer.

3. In Linux server Bob, run "vncserver :10". You can specifiy the display number to other value besides the "10" here. But you'd better specify it to a fix number for the reason of SSH tunneling later.

4. In your Windows, go to SSH menu "edit" => "Setting..." =>  "Outgoing" panel, then click "Add" to add an outgoing tunnel.  In "Listen Port:", input "5901"; in "Destination Port:" input "5910". The "Destination host" should be the default value "localhost". The port "5910" corresponds to the display number "10" in Step 3. Thus you should change it if you use different display number. After you specify the tunnel, you should reconnect to your Linux server Bob by SSH, then keep it open and go to the next step.

5. Run VNC viewer in your Windows. In "VNC server" box, input "localhost:1", then press "OK". The number "1" corresponds to the listen port 5901 in Step 4. Thus you should change it if you use different number there.

6. After you finish VNC connection, you'd better kill the vncserver process generated in Step 3 on your Linux server Bob (to save computer resource). Just use command "vncserver -kill :10" to kill the process.

You can find the official document about VNC over SSH at:

http://www.uk.research.att.com/archive/vnc/sshvnc.html

 

Note:

1. If you have run old VNC before, you should first delete the .vnc directory under your home directory, then run "vncserver :10" --- the new VNC will automatically create a new .vnc in your home directory. At the first time, it will ask you to create a VNC password. The password will be saved in .vnc/ and you will not be asked to create password again under the Linux server.