1. VNCVNC (VirtualNetworkComputer) refers to a virtual network computer. VNC is an excellent remote control tool software with powerful remote control capabilities and high efficiency and practicality. In Linux, VNC includes the following commands: vncserver, vncviewer, vncpasswd, and vncconnect. In most cases, users only need two of them.
VNC (Virtual Network Computer) refers to a Virtual Network Computer. VNC is an excellent remote control tool software with powerful remote control capabilities and high efficiency and practicality. In Linux, VNC includes the following commands: vncserver, vncviewer, vncpasswd, and vncconnect. In most cases, you only need two commands: vncserver and vncviewer.
II. VNCServer1. Installation (1) first, check whether the VNC service is installed on the server: rpm-qa | grep vnc. Install with yum install tigervnc-server if no prompt is displayed, or download the rpm Package to install with the rpm-ivh vnc-4.1.2-14.el5_3.1.i386.rpm and rpm-ivh vnc-server-4.1.2-14.el5_3.1.i386.rpm.
(2) if the package has been installed, the corresponding package is displayed.
2. configuration
(1) open the configuration file vim/etc/sysconfig/vncservers on the server (if the file is not found, tigervnc-server is not installed. use yum install tigervnc-server) and add the following content:
(2) configuration file annotation
VNCSERVERS = "usernumber: myusername", configure the user name for remote desktop login. if two users are using VNCSERVERS = "1: user1 2: user2, and so on.
By default, the default listening port of VNC is 5900,1: user1 corresponds to 5901,2: user2 corresponds to 5902 (the rule is composed of 5900 + usernumber ).
VNCSERVERARGS [1] = "-geometry 1024x768-nolisten tcp-localhost", where "1" is the user serial number, x is the resolution, and-nolisten tcp is the blocking tcp packet, -localhost indicates listening only to the local device. If you want to block the http packet, you can use the configuration: VNCSERVERARGS [1] = "-geometry1024x768-nolisten tcp-nohttpd-localhost ".
(3) set the password
Use su to switch to the user whose vnc password is to be set, as shown in su user1. Use vncpasswd to set the vnc password.
(4) Start
Use su to switch to the user whose vnc password is to be set. enter vncserver in shell to start the VNC service, or use service vncserver start or service vncserver restart.
Run chkconfig vncserver on.
If you want to stop this service, use vncserver-kill: 1.
(6) multiple interfaces
Vncserver: 2. start the second interface for root logon. in this case, use service vncserver stop to stop Interface 1 started at start, and choose other startup interface 2 to stop.
Vncserver-kill: 1. run the kill command to stop the process of Interface 1. Vncserver-kill: 2. run the kill command to stop the process of interface 2.
The service vncserver status command shows the number of process pid numbers, indicating the number of interfaces started.
(6) ports and firewalls
Use netstat-nat | grep 5900 to view the listening ports 5900 and 5901. if the firewall is enabled, you need to configure rules to allow the tcp packet passing through the corresponding port. Use service iptabels status to check whether the corresponding port is ACCEPT or REJECT ).
.
Method 1: Use service iptables stop to disable the firewall (simple but potential attacks exist ).
Method 2: Enter setup under the root user to enter the graphic interface, run the tool, and restart the firewall.
Method 3: modify the firewall configuration file vim/etc/sysconfig/iptables and add the corresponding port
-A input-m state -- state NEW-m tcp-p tcp -- dport 5901-j ACCEPT, and then restart the firewall using service iptables restart.
III. VNCClient1. check the installation of the VNC client to see if the vncviewer command can be used. If not, install tinyvnc.
2. log on to the shell and enter "host Address: 1" (that is, the host IP address and interface number), such as vncviewer 192.168.30.9: 1, and then enter the password:
Go to the logon system interface: