Support &
Documentation
In order to enable this, you must login with
ssh -X <username>@<host>
SSH supports tunneling of X11 (X-Windows). This is also very useful if you want to open graphical displays from the remote machine on your local computer. To achieve this, an X11 server must be running on your local machine. The X11 connections are then tunneled and automatically encrypted by your SSH client.
For some types of graphical software this does not work correctly (if they need input from keystrokes). In those cases you must use
ssh -Y <username>@<host>
This is not recommended otherwise, as a program then potentially has access to do things like keylogging.
In order to use X11, you need to have an X11 server running on your local machine. There are both free and commercial X11 servers available for the various operating systems.
GNU/Linux
OS X
Windows
There are several X11 servers available, here are three that are free.
X-startup-scripts XFree86-lib-compat xorg-* xterm xwinwm lib-glitz-glx1
Then when the Cygwin X server is installed, start an xterm and type XWin -multiwindow in it and then enter. You can now run your SSH client.
Once you are running an X11 server, you will need to enable X11 forwarding/tunneling in your SSH client
The descriptions will be for a few select - but common - ones.
SSH will set the remote environment variable $DISPLAY to "localhost:XX.YY" when this is working correctly. If you had previously set your $DISPLAY environment variable to your local IP or hostname, you must remove any set/export/setenv of this variable from your login scripts. The environment variable $DISPLAY must be left as SSH sets it, which is to a random local port address. Setting $DISPLAY to an IP or hostname will not work.
Note: If you are logging in with GSSAPI, you must forward your credentials (Kerberos ticket) in order to be able to login. There is a little about logging in with GSSAPI here.