Secure Remote Desktop Sharing with VNC on Linux - Getting Started (Page 2 of 5 )
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.
Password:
Verify:
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
Notes:
":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).
Next: Setting up the Environment >>
More BrainDump Articles
More By Barzan "Tony" Antal