VNC 抓取远程桌面

 

        VNC (Virtual Network Computing)是虚拟网络计算机的缩写。VNC 是一款优秀的远程控制工具软件,由著名的 AT&T 的欧洲研究实验室开发的。VNC 是在基于 UNIX 和 Linux 操作系统的免费的开源软件,远程控制能力强大,高效实用,其性能可以和 Windows 和 MAC 中的任何远程控制软件媲美。 在 Linux 中,VNC 包括以下四个命令:vncserver,vncviewer,vncpasswd,和 vncconnect。大多数情况下我只需要其中的两个命令:vncserver 和 vncviewer。本文讲解如何使用VNC进行远程控制,抓取桌面。


#服务端:安装vnc server

#服务端:tigervnc-server-1.0.90-0.15.20110314svn4359.el6.x86_64.rpm

#客户端:tigervnc-1.0.90-0.15.20110314svn4359.el6.x86_64.rpm

[root@larrywen software]# yum install /iso/Packages/tigervnc-server-1.0.90-0.15.20110314svn4359.el6.x86_64.rpm -y

[root@larrywen software]# yum install /iso/Packages/tigervnc-1.0.90-0.15.20110314svn4359.el6.x86_64.rpm -y



#启动服务,设置密码

[root@larrywen software]# vncserver



You will require a password to access your desktops.



Password:

Verify:

xauth: (stdin):1:  bad display name "larrywen.host.com:1" in "add" command



New 'larrywen.host.com:1 (root)' desktop is larrywen.host.com:1



Creating default startup script /root/.vnc/xstartup

Starting applications specified in /root/.vnc/xstartup

Log file is /root/.vnc/larrywen.host.com:1.log



#本地客户端,启动vncviewer

[root@larrywen software]# vncviewer 



#192.168.0.217:5901 然后输入服务端设置的密码,注意需要输入端口号

[root@serv01 ~]# ps -aux|grep 5901

Warning: bad syntax, perhaps a bogus '-'? See /usr/share/doc/procps-3.2.8/FAQ

root      1589  0.0  4.1 111048 32668 pts/0    S    23:00   0:00 /usr/bin/Xvnc :1 -desktop serv01.host.com:1 (root) -auth /root/.Xauthority -geometry 1024x768 -rfbwait 30000 -rfbauth /root/.vnc/passwd -rfbport 5901 -fp catalogue:/etc/X11/fontpath.d -pn



[root@serv01 sysconfig]# service vncserver status

iXvnc (pid 1589) is running...

#启动失败

[root@serv01 sysconfig]# /etc/init.d/vncserver start

Starting VNC server: no displays configured                [FAILED]



#编辑文件

[root@serv01 sysconfig]# vim vncservers 

[root@serv01 sysconfig]# tail -n2 vncservers 

VNCSERVERS="1:root"

VNCSERVERARGS[2]="-geometry 800x600 -nolisten tcp -localhost"

#再次启动

[root@serv01 sysconfig]# /etc/init.d/vncserver start

Starting VNC server: 1:root A VNC server is already running as :1

                                                           [FAILED]

[root@serv01 sysconfig]# /etc/init.d/vncserver stop

Shutting down VNC server: 1:root                           [  OK  ]

[root@serv01 sysconfig]# /etc/init.d/vncserver start



[root@serv01 sysconfig]# vncserver --help



usage: vncserver [:<number>] [-name <desktop-name>] [-depth <depth>]

                 [-geometry <width>x<height>]

                 [-pixelformat rgbNNN|bgrNNN]

                 [-fp <font-path>]

                 [-fg]

                 <Xvnc-options>...



       vncserver -kill <X-display>



       vncserver -list



#可以将连接kill掉

[root@serv01 sysconfig]# vncserver -kill :1

Killing Xvnc process ID 1879

#修改vnc server的密码

[root@serv01 sysconfig]# vncpasswd 



#6601 5801 5901,几个端口,默认是5901,如果不行,可以尝试试下其他几个端口

#查看vncserver的list

[root@serv01 sysconfig]# vncserver -list



TigerVNC server sessions:



X DISPLAY #	PROCESS ID

:1		2062


        参考资料:http://baike.baidu.com/view/160932.htm

我的邮箱[email protected]  新浪微博@Wentasy27

  微信公众平台:JustOracle(微信号:justoracle)

  数据库技术交流群:336882565(加群时验证 From CSDN XXX)

  Oracle交流讨论组https://groups.google.com/d/forum/justoracle

  By Larry Wen


katoon Sina CSDN
@Wentasy 博文仅供参考,欢迎大家来访。如有错误之处,希望批评指正。原创博文如需转载请注明出处,谢谢 :) [CSDN博客]

你可能感兴趣的:(远程桌面)