CentOS 6.5 安装 VNC Server

1.     检查是否已经安装了VNC Server
sudo rpm -q vnc-server
sudo rpm -q tigervnc-server
2.     安装或升级VNC Server

在centos 5用sudo yum install vnc-server
在centos 6要用sudo yum install tigervnc-server


3.     安装Desktop
sudo yum groupinstall Desktop
4.     创建可以使用VNC的用户
不推荐使用root,切换到root
useradd vncuser1
设置密码
passwd vncuser1
useradd vncuser2
passwd vncuser2
5.     配置访问VNC Server用户
vi /etc/sysconfig/vncservers
在末尾添加:
VNCSERVERS="1:vncuser1 2:vncuser2"
VNCSERVERARGS[1]="-geometry 1024x768"
VNCSERVERARGS[2]="-geometry 800x600"


6.     设置vnc 用户的VNC 密码
[~]# su - vncuser1
[~]$ vncpasswd
[~]$ cd .vnc
[.vnc]$ ls
passwd
[.vnc]$ exit
[~]#

7.     配置VNC Server自动启动
# sudo service   vncserver start
# sudo service   vncserver stop
# sudo chkconfig vncserver on
查看vnc状态
sudo chkconfig –list
8.     配置防火墙iptables
vi /etc/sysconfig/iptables
加上:
-A INPUT -m state --state NEW -m tcp -p tcp -m multiport --dports 5901:5903,6001:6003 -j ACCEPT

重启iptables
service iptables restart
9.     启动VNC server
service vncserver start
10.     使用VNC客户端连接
          使用real vnc http://www.realvnc.com/download/viewer/ 连接: ip:1 如, 123.59.44.227:1

 
原文地址:https://www.cnblogs.com/ITHelper/p/4684298.html