[root@localhost ~]# export DISPLAY=ipaddress:0
[root@localhost ~]# xhost +
[root@localhost ~]# yum list | grep vnc
tigervnc.x86_64 1.0.90-0.10.20100115svn3945.el6 @local tigervnc-server.x86_64 1.0.90-0.10.20100115svn3945.el6 @local
[root@localhost ~]# yum install "*vnc*"
[root@localhost ~]# vncserver You will require a password to access your desktops. Password: //输入密码 Verify: //再次输入密码 xauth: creating new authority file /root/.Xauthority New ‘localhost.localdomain:1 (root)’ desktop is localhost.localdomain:1 Creating default startup script /root/.vnc/xstartup Starting applications specified in /root/.vnc/xstartup Log file is /root/.vnc/localhost.localdomain:1.log
[root@localhost ~]# vncserver :2 #注意:2前面一定要有空格。 A VNC server is already running as :2
[root@localhost ~]# ps -aux | grep gnome
[root@localhost /]# cd /root/.vnc [root@localhost .vnc]# vi xstartup
unset SESSION_MANAGER exec /etc/X11/xinit/xinitrc
[root@localhost ~]# vncserver -kill :1 Killing Xvnc process ID 21198 [root@localhost ~]# vncserver New ‘localhost.localdomain:1 (root)’ desktop is localhost.localdomain:1 Starting applications specified in /root/.vnc/xstartup Log file is /root/.vnc/localhost.localdomain:1.log
[root@localhost /]# cd /etc/sysconfig [root@localhost sysconfig]# vi iptables
-A INPUT -m state --state NEW -m tcp -p tcp --dport 5801 -j ACCEPT -A INPUT -m state --state NEW -m tcp -p tcp --dport 5901 -j ACCEPT -A INPUT -m state --state NEW -m tcp -p tcp --dport 6001 -j ACCEPT
-A INPUT -j REJECT --reject-with icmp-host-prohibited
[root@localhost sysconfig]# /etc/rc.d/init.d/iptables restart Flushing firewall rules: [ OK ] Setting chains to policy ACCEPT: filter [ OK ] Unloading iptables modules: [ OK ] Applying iptables firewall rules: [ OK ] Loading additional iptables modules: ip_conntrack_netbios_ns ip_conntrack_ftp [ OK ]
联系客服