Remote access in Linux

Monday, 19 March 2007, michuk

If you have ever tried to access a Windows box remotely, it is very likely you suffered a lot of frustration. Remote desktop works great… but only when you have a stable broadband connection to your remote machine. In GNU/Linux you (as usual) have a choice – you can connect remotely, both graphically and text-based (for maximum performance) using at least a few methods described in the article.

As you know, Windows XP works only in a graphical environment. Thus, when we connect to it remotely, we are condemned to use the GUI. This is called “remote desktop” and it works great… but only when you have a stable broadband connection to your remote machine. When you are on a modem (like GPRS, EDGE) or another type of weak connection, using the remote desktop in a comfortable manner is just not possible. In the case of previous versions of Windows, it’s even worse since the RDP connection is not available there and you are forced to use third party tools like TightVNC or shareware radmin, which does not offer comparable performance to the Remote Desktop.

In GNU/Linux you (as usual) have a choice – you can connect remotely, both graphically and text-based using at least a few methods described below.

  • Connect via SSH
    SSH is a secure shell, the secure descendant of telnet protocol. SSH enables you to access a shell of a remote machine in a secure manner (the transmission is encrypted). What can you do with the shell? In short: everything that you can do with the GUI plus a lot more. Check out the article The power of the Linux Console to see the details. Via SSH you can also run remote graphical apps on your local machine, provided that you have an X-server installed locally (this is the default in GNU/Linux and BSD and easily available in MacOSX; for Windows you need to run additional program for that, e.g. the X-server from the free cygwin package or commercial WinaXe). SSH is the most popular and the safest way to work remotely on a Linux box. However, if you need to access your whole desktop remotely, you can use one of the technologies described in the following points.


Skype run over an SSH tunnel

Pic.1 Skype run over an SSH tunnel — a viable solution for
restricted networks with blocked ports

  • Pure XDMCP connection
    This X-server function is disabled by default in most of the Linux distributions due to the low level of security it offers (no transmission encryption). However, run over an SSH tunnel, XDMCP connection can be a good way to access your home desktop from a remote machine. It has to be mentioned that it needs a pretty fast Internet connection to work flawlessly.
  • Desktop Sharing in KDE and GNOME
    K Desktop Environment has an option called “desktop sharing”, which is a client-server solution provided by the kdenetworks package (krdc + krfb). Desktop sharing is realized through the RFB protocol (better known as VNC) and is compatible with any other VNC client. The benefit of KDE Desktop Sharing is the GUI interface for setting it up both on the server and client level. We can use a neat wizard to enable remote access to particular machines and users, set proper passwords, etc.
  • GNOME, on the other hand, provides its own framework for remote connections, called Vino. The solution is also VNC-based. Vino is just another VNC server which is strictly integrated with GNOME. It allows you to access your GNOME desktop remotely in order to work or perform system diagnosis.

    As far as the performance is concerned I haven’t noticed any significant difference between GNOME and KDE desktop sharing.


KDE Desktop sharing

Pic.2 KDE Desktop sharing
— configuring a connection

  • Connect using external tools like FreeNX or VNC
    Using external tools like different VNC programs (RealVNC, TightVNC, Vnc4 and more) or a less popular but much more efficient FreeNX, gives you another possibility to access your machine remotely. Both technologies enable you to log in remotely or access an existing X session (read-only or read-write). These two technologies are platform independent and can be used in any combination between GNU/Linux and MS Windows systems.

So, what do we get gratis when using GNU/Linux? The key thing seems to be the option to access a remote shell in a text-based way and the possibility to run single applications remotely (without having to download the whole environment) thanks to SSH and tunneling. Desktop sharing in Windows and Linux is on a similar level. I could even take the risk of saying that the default Windows Remote Desktop is a superior solution to XDMCP or desktop sharing in GNOME and KDE. When platform-independent technologies are used (VNC, FreeNX or non-free NX client/server) the performance is similar in both environments. It has to be mentioned that the commercial NX package is the best solution when you are short on bandwidth.

Further reading: