Advanced Network and System Administration Remote Desktops Copyright@2009, HaiVDC 1
Topics 1. X Windows 1. Client/server windowing 2. Window managers and desktops 3. Security 2. VNC 1. Why VNC? 2. Configuring 3. Security 3. NX Copyright@2009, HaiVDC 2
X-Windows Network-based windowing system. Server Client Handles user input and graphical display. Runs on the machine with display unit. Graphical applications are clients. Can run on a different machine than server. Set DISPLAY environment variable. Or use display command line option. Copyright@2009, HaiVDC 3
Window Manager X client that provides features like: Move, resize, iconify, and kill windows. Window title bars. Popup menus. Example window managers twm: Tab, primitive early window manager mwm: Motif, found on commercial UNIXes fvwm: Free, fast, very customizable. WindowMaker: NeXT-like, see also AfterStep. Copyright@2009, HaiVDC 4
TWM Screenshot Copyright@2009, HaiVDC 5
FVWM Screenshot Copyright@2009, HaiVDC 6
WindowMaker Copyright@2009, HaiVDC 7
Desktops CDE Common desktop env for commercial UNIXes. Gnome Standard Linux desktop based on GTK+. KDE Windows-like free desktop based on QT. Xfce Lightweight desktop, also based on GTK+. Copyright@2009, HaiVDC 8
X-Windows Security Why do we need security? An evil client can capture/create any X events. Even if you re not using any network clients! Host authentication Limit who can start clients by IP address. Set by xhost + or xhost - commands. Token authentication Only clients with token can access server. Set by the xauth command. Copyright@2009, HaiVDC 9
X-Windows Security Tunneling + host authentication. All clients appear to be from localhost. Therefore disable remote clients with xhost Use ssh client to tunnel X: ssh X host Server must have X11Forwarding set to yes. Use echo DISPLAY to test if X forwarding is on. Note that local users can still attack X session. Copyright@2009, HaiVDC 10
VNC: Virtual Network Computing Copyright@2009, HaiVDC 11
Why VNC? 1. Remote desktop access. 2. Helpdesk: control a remote desktop. 3. Persistent desktop. 4. Use same desktop from multiple clients. 5. Need Linux access from Windows. 6. Need Windows access from Linux. Copyright@2009, HaiVDC 12
What is VNC? Open remote desktop protocol. Many implementations RealVNC: VNC from original researchers. TightVNC: VNC with high compression. VNCj: Java VNC, can run within web browser. PalmVNC: VNC for Palm Pilots. UltraVNC: enhanced VNC, only for Windows. Copyright@2009, HaiVDC 13
Using VNC 1. Start VNC server UNIX: vncserver Win: Start menu>programs>realvnc>vncserver 1. Write down server name and display number. It will look something like unix3:1 1. Start VNC client UNIX: vncviewer Win: Start menu>programs>realvnc>vncviewer 1. Enter server and display to connect to (from step 2). 2. A VNC remote desktop should appear. Copyright@2009, HaiVDC 14
Configuring and Troubleshooting On UNIX, VNC stores files under ~/.vnc Configuration: xstartup Indicates which X clients to start with server. Typically includes vncconfig application. Configuration: passwd Contains VNC server session password. Log files: host:display#.log Any errors should appear in these logs. Copyright@2009, HaiVDC 15
Securing VNC VNC does not provide encryption. Use ssh tunneling to encrypt login + data: ssh L 5901:remotehost:5901 remotehost vncviewer localhost:1 Copyright@2009, HaiVDC 16
NX Advantages over VNC: Speed: fast enough to use over dialup. Built-in ssh encryption. Disadvantages Immature code; hard to install + set up. GPL client/server for Linux only. Free Windows client; commercial server. Copyright@2009, HaiVDC 17
References 1. Daniel J. Barrett, Robert G. Byrnes, Richard E. Silverman, SSH, The Secure Shell, 2 nd edition, O Reilly, 2005. 2. John Fisher, Secure X Windows, CIAC 2316, http://www.ciac.org/ciac/documents/ciac2316.html, 1995. 3. No Machine NX, http://www.nomachine.com/ 4. RedHat, Red Hat Enterprise Linux 4 System Administration Guide, http://www.redhat.com/docs/manuals/enterprise/rhel-4-manual/sysadmin-guide/, 2005. 5. Real VNC, http://www.realvnc.com/ 6. runeb, Crash Course in X Windows Security, http://bau2.uibk.ac.at/matic/ccxsec.htm 7. Carla Schroeder, Linux Cookbook, O Reilly, 2004. 8. Carla Schroeder, FreeNX ups the Remote Linux Desktop Ante, Enterprise Networking Planet, http ://www.enterprisenetworkingplanet.com/netos/print.php/3508951, 2005. 9. Webmin, http://www.webmin.com/ 10. Window Managers for X, http://xwinman.org/ Copyright@2009, HaiVDC 18