1. Install the GNOME desktop here is the script installation used. The code is as follows: Add attachment#!/bin/sh#This script is free and written by www.vpsyou.com# Install Yum-fastestmirroryum-y Install Yum-fastestmirror# Create New Soft Download dirmkdir-p/backup/www.vpsyou.com; cd/backup/www.vpsyou.com; # Install X Window softwaresyum-y groupinstall "X window System"yum-y groupinstall "GNOME Desktop Environment"yum-y Install NC expect FreeNXyum-y Groupinstall Chinese-support#install Firefoxyum-y Install Firefox# Copy Client.id_dsa.key to/backup/www.vpsyou.com/# Please use the FTP or winscp to download itcp/etc/nxserver/client.id_dsa.key/backup/www.vpsyou.com/chmod 755/backup/www.vpsyou.com/client.id_dsa.key# iptablesiptables-a input-i lo-s 127.0.0.1-j ACCEPTiptables-a input-p tcp--dport 22-j ACCEPTiptables-a output-p UDP--sport 22-j ACCEPTiptables-a input-p tcp--dport 5000-j ACCEPTiptables-a output-p UDP--sport 5000-j ACCEPTsed-i ' s#selinux=enforcing#selinux=disabled ' #/etc/selinux/configecho "==========================="Get_char () { savedstty= ' stty-g 'Stty-echoStty CbreakDD if=/dev/tty bs=1 count=1 2>/dev/nullStty-rawStty EchoStty $SAVEDSTTY } echo ""echo "======= Download FreeNX Windows software: ======="echo ""echo "http://www.nomachine.com/download-client-windows.php"echo ""echo ""echo "======= How to use FreeNX connect to your Linux X window System: ======="echo "http://www.vpsyou.com/centos-install-desktop/"echo ""echo "Install X window System successful,press any key to end ..."char= ' Get_char '
2. Installing Vncyum install Vnc-server vnc*-y3, configuring and booting Vncvi/etc/sysconfig/vncservers
4. Set the password for the remote user vncserver:1 or vncpasswd or vncpasswd root # #默认是root5. Modify the Remote Desktop Display profile directory in/ROOT/.VNCVI Xstartup # #这个文件附 The contents of this piece are as follows:#!/bin/sh# ADD The following line to ensure a xterm available.# Uncomment the following-lines for normal desktop:unset Session_managerEXEC/ETC/X11/XINIT/XINITRC[-x/etc/vnc/xstartup] && exec/etc/vnc/xstartup[-R $HOME/. Xresources] && Xrdb $HOME/. XresourcesXsetroot-solid GreyVncconfig-iconic &xterm-geometry 80x24+10+10-ls-title "$VNCDESKTOP Desktop" &#twm &Gnome-session &
6. Open VNC Service /sbin/service vncserver start
/sbin/service Vncserver Stop
sbin/service vncserver Restart
Service Vncserver Restart7. See which ports VNC listens on netstat-luntp | grep "VNC"
7. Modify the firewall policyVi/etc/sysconfig/iptables-A rh-firewall-1-input-p tcp-m tcp--dport 5801-j accept-a rh-firewall-1-input-p tcp-m tcp--dport 5901-j ACCEPT-A R H-firewall-1-input-p tcp-m TCP--dport 6001-j ACCEPT
8. Restart the Firewall service iptables restart9. Boot vncvi/etc/rc.d/rc.local /etc/init.d/vncserver start --Add a row
########## #想杀掉已启动的VNC客户端如下:
Vncserver-kill:1
vncserver-kill:2
Windows logon Test
VNC Viewer Login Test
You can also log on to a Web test that must support Java
http://ip:5801/
From for notes (Wiz)
List of attachments
Linux Installation Desktop Environment (GNOME) VNC connection Linux