HOWTO: Tunnel Gnome, KDE, and X11 applications through SSH
Besides offering the user a remote shell, SSH can also run X11 applications on a remote computer. This extends even to desktop environments such as GNOME and KDE, as they consist of a collection of separate applications.
I have used this method with two computers running Kubuntu 7.04. However, the computers do not necessarily need to run the same environment or even the same distribution.
1. On the server, install a desktop environment and OpenSSH server, if they are not already present. An X server is not required.sudo aptitude install openssh-server
3. On the client, press Ctrl+Alt+F1 to show a terminal. Log in and typexinit /usr/bin/xterm -- :1
Note: In distributions besides Ubuntu and Debian, the xterm executable may be in a different place. Use the command whereis xterm
4. In the new terminal, open an SSH connection to the server. Type:ssh -Y username@hostname
5. The SSH client will ask you for your server password. Enter it. :)
6. Now that you have a shell prompt, all you need to do is launch the desktop enviroment.
For GNOME: gnome-session
startkde
startxfce4