Tuesday, November 24, 2009

SSH X11 Forwarding

Here's a nice little trick for SSH users. Did you know that you can forward X11 traffic through an SSH connection? All you got to do is this:

If your SSH'ing to a linux machine from a linux machine just issue the command:

# ssh -X username@ipaddress

If your SSH'ing to a linux machine from a Windows machine you need get the following:
Xming X Server

You might also need to install some fonts found here (I however didn't need to do this):

  • Now just install Xming and the Fonts (if the Fonts are needed) into the default directory.
  • Then launch PuTTY and enter in the username@ipaddress into the "Host Name" field
  • Go to the Connection>SSH>X11 section in PuTTY and check the "Enable X11 forwarding" option
  • Also, if needed, set the "X display location" to localhost:0

Once you connect you will be able to issue commands in the command line as you would normally but also run programs that have a GUI. A really cool feature is that the windows are created in your local OS unlike VNC and RDP where the windows are bound inside the Remote Desktop Application window.

Note: The SSH Deamon running on the server might need to be configured to allow X11 Forwarding. Just do a google search to get this information (it generally just requires you to uncomment a line in a configuration file).


No comments:

Post a Comment