One, install tigervnc-server VNC package [[[email protected] ~]# yum install tigervnc-server[[email protected] ~]# RPM-QC Tigervnc-server/etc/sysconfig/vncservers[[email protected] ~]# chkconfig--level vncserver on two. Purpose: Start the first port with the Vistor user, which is 5901, to student the user to start the second port, i.e. 5902[[email protected] ~]# vim/etc/sysconfig/vncserversvncservers = "1:visitor 2:student" vncserverargs[2]= "-geometry 1400x900-nolisten tcp-localhost with VNC user login system, create VNC password, vncpasswd[[ Email protected] ~]# su-visitor[[email protected] ~]$ vncpasswdpassword: Enter password Password must is at least 6 Chara Cters-try Againpassword: Enter password again verify: Start the service once, generate /home/visitor/.vnc/xstartup[[email protected] ~]$ Vncserver new ' Localhost.localdomain:1 (visitor) ' Desktop is localhost.localdomain:1 starting Applications specified In/home/visitor/.vnc/xstartuplog file is/home/visitor/.vnc/localhost.localdomain:1. Log to view the VNC service that is already open, close the service [[email protected] ~]$ VNCSERVER-LIST TIGERVNC Server Sessions: x DISPLAY # PROCESS id:1 5567[[email protected] ~]$ vncserver-kill:1killing Xvnc process ID 5567[[email protected] ~]$ exitlogout[[email protected] ~]# su-s Tudent[[email protected] ~]$ vncpasswd password:verify:[[email protected] ~]$ Vncserver xauth: creating new Authority file/home/student/. Xauthority new ' Localhost.localdomain:1 (student) ' Desktop is localhost.localdomain:1 creating default Startup script/home/student/.vnc/xstartupstarting Applications specified In/home/student/.vnc/xstartuplog file is/ Home/student/.vnc/localhost.localdomain:1.log [[email protected] ~]$ Vncserver-list tigervnc Server Sessions: x DISPLAY # PROCESS id:1  8764[[EMAIL&N Bsp;protected] ~]$ vncserver-kill:1killing Xvnc process ID 8764[[email protected] ~]$ exitlogout III, Start service [[EMAIL&NBSp;protected] ~]#/etc/init.d/vncserver Start is starting the VNC server: 1:visitor new ' localhost.localdomain:1 (visitor) ' Desktop is localhost.localdomain:1 starting applications specified in/home/visitor/.vnc/xstartuplog file Is/home /visitor/.vnc/localhost.localdomain:1.log 2:student new ' Localhost.localdomain:2 (student) ' Desktop is localhost.localdomain:2 starting applications specified In/home/student/.vnc/xstartuplog file is/home/student/ .vnc/localhost.localdomain:2.log , &N Bsp [OK] four. add firewall configuration [[email protected] ~]# vim/etc/sysconfig/iptables-a input-m State--state new-m tcp-p TCP--dport 59 01-j accept-a input-m State--state new-m tcp-p TCP--dport 5902-j accept[[email protected] ~]# service iptables restartiptables:flushing Firewall rules: &nbsP [ ok ]iptables:setting chains to Policy Accept:filter [ ok ]iptables:unloading modules: &NBS P [ ok ]iptables:applying F Irewall rules: [ ok ]  ; five. Remote access six. Connect using secure SSH vnc is clear and unsafe. The connection process may be bugged and interfered with. Security can be increased by using SSH channel encryption and then communicating with the loopback address of the remote host. [[email protected] ~]# vim/etc/sysconfig/vncserversvncserverargs[1]= "-localhost" [11:30:18 [email Protected] ~]$ Vncviewer-via [email protected] localhost:1 here localhost is the loopback address of the remote host, resolved by the remote host seven. Generate a password file, login without input password [[email protected] ~]# vncpasswd virtualpassword:verify:[13:43:02 [email protected] study]$ VNCVIEWER-PASSWD ~/study/virtual-via [email protected] Localhost:3&nbSP; eight. Multi-User Configuration vncservers= "3:root 2:student" vncserverargs[2]= "-geometry 800x600-localhost" vncserverargs[3]= "-geometry 1024x768-localhost"
Installation and configuration of VNC