Secure Remote Desktop Sharing with VNC on Linux - More Useful VNC Commands (Page 4 of 5 )
One might ask how can we close and stop the vncserver service if it's running. You can kill it using the following command:
vncserver -kill :# //where # is the display no.
Also, another useful tip is that you can set up your vncserver to start automatically every time your Linux system boots up. One of the ways to do this is by adding a new line to your "/etc/rc.d/rc.local." This shouldn't surprise you if you're familiar with Linux. A quick example would be adding the following line:
su - user_name -c "cd /home/user_name && vncserver :1 -geometry 1024x768 -depth 16"
In the above command you need to replace "user_name" with the specific user on which you want to run your VNC Server. The command "su" basically runs the command in "" (quotation marks) at the specified username-when executing more than one command, you need to separate each of them with &&. In our case, it changes the current directory to /home/user_name and executes the "vncserver :1 -geometry 1024x768 -depth 16" command.
We shouldn't forget about the "vncpasswd" command that allows us to change the password for our VNC Server.
Next: Final Words >>
More BrainDump Articles
More By Barzan "Tony" Antal