Tuesday, October 16, 2012

Share your Linux desktop with x11vnc

x11vnc is a pretty useful program that you can use to share your Linux desktop with someone far away. To start x11vnc while using X11 windows, issue the following command:



x11vnc -display :0


This command will work in most cases, assuming there is only one instance of X11 Windows server running. However, the display number could be different. To be sure, type the following command:



xdpyinfo | head


x11vnc will output a lot of information, including the port number it runs on:



The VNC desktop is:      bootcd:2
PORT=5902


Subtracting 5900 from the port number (5902), you'll get the display number (2). Use this number to connect to your desktop remotely. I use gvncviewer.



gvncviewer 192.168.200.83:2


TightVNC viewer on Windows Vista




Administrator To Monitor Someone's Desktop with X11VNC



Let's assume that you are a system administrator with root privilege and want to monitor a user's X11 Windows desktop. You can't just run “x11vnc -display :0” because you are not the user currently using display :0. In that case, you need access to the X11 Windows' xauth file which is located at one of the following locations:




  • /var/lib/gdm
  • /var/lib/kdm
  • /var/lib/xdm/authdir/authfiles
  • /home/USER/.Xauthority


Once you locate the xauth file associated with the user's X11 desktop, you can use x11vnc to monitor his desktop activity.



x11vnc -display :0 -auth /var/lib/gdm/\:0.Xauth


Then, on your desktop as administrator, connect to the user's desktop with a vnc client.



gvncviewer 192.168.200.83:2


x11vnc with SSL



x11vnc supports various connection schemes, including SSL. On Debian and Ubuntu, type the following command to create a SSL certificate for use with x11vnc.



cat /etc/ssl/private/ssl-cert-snakeoil.key /etc/ssl/certs/ssl-cert-snakeoil.pem > /tmp/x11vnc.pem


Then, start x11vnc with -ssl option to run x11vnc in secure mode.



x11vnc -display :0 -auth /var/lib/gdm/\:0.Xauth -ssl /tmp/x11vnc.pem


ssvnc and gvncviewer can be used to connect to x11vnc via SSL connection. The following example command starts x11vnc in anonymous SSL mode that doesn't require X509 exchange.



x11vnc -display :0 -xauth /var/lib/xdm/authdir/authfiles/A\:0-R2x5Db -xkb -nopw -nc_cr -ssl /tmp/x11vnc.pem -vencrypt newdh:nox509:support

No comments:

Post a Comment

About This Blog

KBlog logo This blog seeks to provide a collection of interesting pictures found on the Web. Thanks for visiting the blog and posting your comments.

© Contents by KBlog

© Blogger template by Emporium Digital 2008

Followers

Total Pageviews

Powered By Blogger