1. configure VNCServer to edit the vi/etc/sysconfig/vncservers file and add VNC users. Add the following line to the end of the vncservers File: & mdash; & mdash;
1. configure the VNC Server
Edit the vi/etc/sysconfig/vncservers file and add a VNC user.
Add the following line to the end of the vncservers file:
-------------
VNCSERVERS = "1: root"
--------------
Note:
*. The added user (root user) must already exist.
*. "1" indicates the session number. You can add multiple sessions to provide multiple Remote Desktop Services at the same time.
2. configure the VNC Server password
Run the command: # vncpasswd to set the vnc logon password.
After the password is set, a file named "passwd" is generated under the path/root/. vnc.
If you want to change the VNC Server password, run the # vncpasswd command again.
3. start the vncserver service
# Vncserver (xstartup file is available only after startup)
4. modify the VNC service remote desktop startup mode
Vi/root/. vnc/xstartup
Comment out the last line of twm & and modify it as follows:
--------------
# Twm &
Startkde &
--------------
Save the file and start the vncserver service again. # service vncserver restart
Test connection: IP Address: 1 (for example, 10.160.202.8.0: 1]
5. common commands of VNC Server
*. Vncserver restart command:
# Service vncserver stop
# Service vncserver start
Or:
# Service vncserver restart
*. Command for viewing the vncserver Service Status:
# Service vncserver status
*. View the vncserver listening port command:
# Netstat-tlnp | grep vnc
By default, the VNC Server provides the following port numbers for access through a browser: 5800 + session numbers. the port numbers for access through the VNC Viewer client are 5900 + session numbers.
If you need to provide a cross-firewall server, the firewall needs to open the corresponding port.
*. Run the following command to end the service:
# Vncserver-kill: Session ID
For example: # vncserver-kill: 1 // end the service whose session number is 1
This article is from "1"