Introduction: You must understand that when calling the vncserver, it will enable the server listening port based on your configuration. the default port is from 5900, and your desktop number is added. For example, if your desktop number is 1, the connection port number of vnc is 5900 + 1 = 5901. for example, if your desktop number is 10000, the connection port number of the vnc is 5900 + 10000 = 15900 ==========================
Introduction:
You must understand:
When the vncserver is called, it will enable the server listening port according to your configuration,
By default, the port starts from 5900 and your desktop number is added.
For example, if your desktop number is 1, the connection port number of vnc is 5900 + 1 = 5901.
For example, if your desktop number is 10000, the connection port number of vnc is 5900 + 10000 = 15900.
========================================================== ====================================
Configure the VNC server below so that the user (root) can remotely connect to the linux system Gui through the vnc client (provided that the desktop is installed on your server)
1. check whether VNC is installed in linux.
Enter the following command in the terminal window:
rpm -q vnc-server
The returned information is as follows:
package vnc-server is not installed
The vnc server is not installed.
2. run the following command for installation:
yum install vnc vnc-server
3. start the VNC service
vncserver You will require a password to access your desktops. Password: Verify:
You will be prompted to enter the password, which is required for remote logon. enter the password and press enter.
4. switch to the root account: su root and enter the password of the root account.
Vi/etc/sysconfig/vncservers # vnc configuration file VNCSERVERS = "10000: root" # previously # canceled 10000: root (desktop number: user) # VNCSERVERARGS [2] = "-geometry 800x600-nolisten tcp-localhost"
Save and exit
5. configure the firewall to allow port 10000 + 5900 = Port 15900 to pass through the firewall (otherwise, the VNC server cannot be remotely connected)
Vi/etc/sysconfig/iptables-a input-m state -- state NEW-m tcp-p tcp -- dport 15900-j ACCEPT (allow port 15900 to pass the firewall)
Save and exit
6. restart the vnc server.
/Etc/init. d/vncserver restart or service vncserver restart
7. restart the firewall to make the port configuration take effect.
/etc/init.d/iptables restart service iptables restart
8. set the vnc server to automatically start upon startup
Method 1: run the "ntsysv" command to start the graphical service configuration program. add an asterisk to the vncserver service and click "OK". The configuration is complete.
Method 2: Use "chkconfig" to operate in command line mode. use the following command:
chkconfig vncserver on chkconfig --list vncserver vncserver 0:off 1:off 2:on 3:on 4:on 5:on 6:off
9. change the vnc connection password
Vncpasswd
At this point, the VNC server has been set up and can be connected using the VNC client.
Vnc server: your ip: 15900
Note: If the gray screen appears after the connection, you can set it as follows:
Go to the user's home directory,Cd/home/user
If you log on with the root account, the current directory is the root directory of the user.
Cd ~ /. Vnc vi xstartup # Edit # twm & # Comment out this line of gnome-session & # add this line
Save and exit to connect normally!
This is a success. you can use http: // IP: port to log on to the WEB.