vncserver runs as a system V service in Fedora 6. We need to do some configuration to allow connections from different users. Modify the /etc/sysconfig/vncservers configuration file to set the connections up:
Find the lines that look like this:
And add your configurations however you'd like. Many options are detailed in this configuration file. Here's a few good ones:
-nolisten tcp - Prevents X connections to the VNC Server over TCP -localhost - Prevents remote VNC clients from connecting, except when they do a ssh tunnel.
Here is my /etc/sysconfig/vncservers file on a system I recently configured:
VNCSERVERARGS="-geometry 640?480 -localhost"
Of course, we should make a password for each of our users as well. This password should probably not be the same as the user's login, but nothing prevents the password from being the same. To change the users password, login as that user and run vncpasswd:
Finally, we need to make sure vncserver starts correctly:
Starting VNC server: 1:root
New 'station5.example.com:1 (root)' desktop is station5.example.com:1
Starting applications specified in /root/.vnc/xstartup
Log file is /root/.vnc/station5.example.com:1.log
New 'station5.example.com:2 (student)' desktop is station5.example.com:2
Starting applications specified in /home/student/.vnc/xstartup
Log file is /home/student/.vnc/station5.example.com:2.log
Once started, test out the connections. These two connections have been configured differently.
Connection 1 will let me connect as root with a screen size of 800?600 over an insecure vnc connection. Connection 2 will let me connect as student but only via an ssh tunnel. Let's have a look at how we'd connect:
Connecting as root to station5:
$ vncviewer station5:1
$ vncviewer via root@station5 localhost:2
This prompt appears. Enter the password you created earlier with vncpasswd.