一.远程图形操作服务端机器

  1. 服务端机器,安装vncserver.

    yum install *vnc -y

  2. 配置服务端

    rpm -qc vncserver                #-qc可以查看rpm包配置文件位置

    vim /etc/sysconfig/vncserver

    VNCSERVERS="1:vncuser"

3. 建立连接用户和vnc服务器端密码

[root@demo yum.repos.d]# useradd vncuser

[root@demo yum.repos.d]# 

[root@demo yum.repos.d]# passwd vncuser

Changing password for user vncuser.

New password: 

BAD PASSWORD: it is too short

BAD PASSWORD: is too simple

Retype new password: 

passwd: all authentication tokens updated successfully.

[root@demo yum.repos.d]# su - vncuser

[vncuser@demo ~]$ 

[vncuser@demo ~]$ 

[vncuser@demo ~]$ vncpasswd 

Password:

Verify:

[vncuser@demo ~]$ 

[vncuser@demo ~]$ exit

logout

4. 重启服务

    service vncserver restart

[root@demo yum.repos.d]# service vncserver restart

Shutting down VNC server:                                  [  OK  ]

Starting VNC server: 1:vncuser xauth:  creating new authority file /home/vncuser/.Xauthority


New 'demo.example.com:1 (vncuser)' desktop is demo.example.com:1


Creating default startup script /home/vncuser/.vnc/xstartup

Starting applications specified in /home/vncuser/.vnc/xstartup

Log file is /home/vncuser/.vnc/demo.example.com:1.log


                                                           [  OK  ]


[root@demo yum.repos.d]# chkconfig vncserver on

[root@demo yum.repos.d]# service iptables stop

[root@demo yum.repos.d]# 

[root@demo yum.repos.d]# setenforce 0


[root@demo yum.repos.d]# netstat -antlp |grep vnc

tcp        0      0 0.0.0.0:5901                0.0.0.0:*                   LISTEN      31424/Xvnc          

tcp        0      0 0.0.0.0:6001                0.0.0.0:*                   LISTEN      31424/Xvnc          

tcp        0      0 :::6001                     :::*                        LISTEN      31424/Xvnc          

5.客户端连接

    [root@instructor 1028]# vncviewer 192.168.0.250:1