Specific methods
1. Check whether the Linux system installs VNC command Rpm-q vnc-server
Use yum install VNC vnc-server if it is not installed
2. Start VNC Service
| The code is as follows |
Copy Code |
Vncserver You'll require a password to access your desktops. Password: Verify:
|
Enter the password two times, which is the password you need to log on remotely.
3. Modify configuration file, root account
| The code is as follows |
Copy Code |
Vi/etc/sysconfig/vncservers
|
New and below configuration
| The code is as follows |
Copy Code |
vncservers= "10000:root" #10000: Root (Desktop number: User) vncserverargs[2]= "-geometry 1024x768-nolisten tcp-localhost"
|
4. Configure the firewall to allow the 10000+5900=15900 port to access the desktop through the firewall
| The code is as follows |
Copy Code |
Vi/etc/sysconfig/iptables
-A input-m state–state new-m tcp-p tcp–dport 15900-j ACCEPT |
5. Restart VNC services and firewalls.
| The code is as follows |
Copy Code |
/etc/init.d/vncserver restart /etc/init.d/iptables restart
|
6. Set VNC self-boot
| The code is as follows |
Copy Code |
Chkconfig Vncserver on
|
Change password you can use the VNCPASSWD command
The above is my operation process, later from sentient beings to find a picture and text of the tutorial, we do not refer to the
Use SSH software to connect to the system, start VNC service with command vncserver
The first time you use vncserver prompts for a password, and then retype it again (enter geisnic.com here
As a password, you must remember this password), enter the following figure prompts:
Remember dispay# here, this is feng:1,display# is 1.
Open the file in the current user's home directory. Vnc/xstartup, because this is the root user, so the file is in the/root directory, after opening the file, comment out all rows, add a line Gnome-session &, save exit.
Using the command Vncserver-kill:d ispaly# The dispaly# view is shown in the previous steps, here is 1, enter command return
Re-use the command vncserver restart the service
Remember that the dispaly# here is 1.
Vncserver default port is 5900, this port is open in the firewall
Vi/etc/sysconfig/iptables
Locate the following statement:
-A rh-firewall-1-input-j Reject--reject-with icmp-host-prohibited
Before this trip, add the following:
-A rh-firewall-1-input-m state--state new-m tcp-p TCP--dport 5900:5903-j ACCEPT
Then restart the Iptables service: Services iptables restart
Can.
Open the Software vnc Viewer (VNC client) on the local system and enter the machine's IP address plus dispaly#
Here is 118.126.16.219:1
Point OK, the following input box appears, enter the password you just set geisnic.com
Click OK to log on to the system
Set Vncserver to boot automatically: Chkconfig vncserver on