Home arrow BrainDump arrow Page 2 - Secure Remote Desktop Sharing with VNC on Linux

Getting Started - BrainDump

This article is the second half of a two-part series on secure remote desktop sharing with VNC. If you missed the first part, which appeared Monday on ASP Free, I'd suggest skimming through it, at least. The first part was an introduction to VNC connections and it focused on Windows. This one will get into the depths of configuration, optimization and explain ways to set up and benefit from VNCs on Linux platforms too.

  1. Secure Remote Desktop Sharing with VNC on Linux
  2. Getting Started
  3. Setting up the Environment
  4. More Useful VNC Commands
  5. Final Words
By: Barzan "Tony" Antal
Rating: starstarstarstarstar / 16
April 24, 2007

print this article



First we need to make sure that no previous VNC packages are installed. Running the command below uninstalls the specified package. Usually two packages are already installed, and these are vnc and vncserver. Try the command below for these two.

rpm -e name_of_the_package

Then go to the folder location where you've downloaded your new TightVNC RPM. Run the following command to install:

rpm -ivh exact_name_of_the_package_goes_here                

If you are in a rush and don't like using the TAB auto-completion you might run the following command instead of the previous one:

rpm -ivh tightvnc*rpm

If the installation ends successfully you should see the following lines or something similar:

Preparing...                ########################### [100%]

   1:tightvnc-server        ########################### [100%]

Next you need to actually run the server. Type the following command:

vncserver :1 -geometry 1024x768 -depth 16

When you run the command, it's going to ask for a password. Decide whether or not you want to use a separate view-only password. You should just type in the password you desire and then hit enter. Of course, running "vncserver :1" is enough but this way you have the ability to customize and add advanced options. Check out the way it starts up.

You will require a password to access your desktops.




Would you like to enter a view-only password (y/n)? n


New 'X' desktop is localhost:1


Creating default startup script /root/.vnc/xstartup

Starting applications specified in /root/.vnc/xstartup

Log file is /root/.vnc/localhost:1.log


  • ":1" is the display ID. The number 1 is just an example. The ports that will be open and allocated by the VNC server are the following: 5801, 5901 and 6001 (that's if the # is 1, otherwise it's 5800+#, and so on);
  • "-geometry" attributes the resolution;
  • "-depth" stands for the color depth.

To back up my previous statement I've run "netstat -ta." Here is its output:

Active Internet connections (servers and established)

Proto Recv-Q Send-Q Local Address           Foreign Address         State

tcp        0      0 *:5801                  *:*                     LISTEN

tcp        0      0 *:5901                  *:*                     LISTEN

tcp        0      0 *:6001                  *:*                     LISTEN

Obviously, you're going to have more connections. I've deleted the rest to reduce the size of the table that I've attached. Currently, those are the ones we care about.

That should be all you need to do on your server. Both SSHd and VNCserver should be running by now. Now, I'm going to lead you through the steps that you need to follow to be able to view your server from a remote computer (which also runs Linux).

>>> More BrainDump Articles          >>> More By Barzan "Tony" Antal

blog comments powered by Disqus
escort Bursa Bursa escort Antalya eskort


- Apple Founder Steve Jobs Dies
- Steve Jobs` Era at Apple Ends
- Google's Chrome Developer Tool Updated
- Google's Chrome 6 Browser Brings Speed to th...
- New Open Source Update Fedora 13 is Released...
- Install Linux with Knoppix
- iPad Developers Flock To SDK 3.2
- Managing a Linux Wireless Access Point
- Maintaining a Linux Wireless Access Point
- Securing a Linux Wireless Access Point
- Configuring a Linux Wireless Access Point
- Building a Linux Wireless Access Point
- Migrating Oracle to PostgreSQL with Enterpri...
- Demystifying SELinux on Kernel 2.6
- Yahoo and Microsoft Create Ad Partnership

Developer Shed Affiliates


Dev Shed Tutorial Topics: