Handling X11 Forwarding Using SSH

putty1This will guide you through the steps to access a Linux server, specifically, a Red hat Enterprise Linux 5.4 or CentOS 5.4 server, through the use of PuTTy and Xming. It is a relatively simple setup that will require only two freeware products and a quick verificatino of setting on the Linux server. With the use of these two tools and a little configuration, it is easy to do. It makes for a great compromise between command line and GUI. As I understand it, all applications in the Linux environment have a command-line alternative to their GUI. So you can run your Linux box through this combination of tools.

Configuration Settings
On the Linux server, open the SSH configuration file.

 vim /etc/ssh/sshd_config

Check for the following line.

 Ensure X11Forwarding yes

Prerequisites

  • Download and install Xming X Server (Version 6.9.0.31) – a X Window server for Microsoft Windows
  • Download and install PuTTY – an SSH client.

Xming Configuration

  • Run Xming (Start > Programs > Xming > XLaunch)
  • At the Display settings dialog box, select Multiple windows and set the Display number as 0. Click on Next. Click Next until Finish.

PuTTY Configuration

  • Start PuTTY
  • Go to PuTTY Configuration from the left pane by selecting Connection > SSH > X11.
  • From the right pane, select the Enable X11 forwarding checkbox and set the X display location as :0.0
    putty2
  • From the left pane, select Session.
  • Type in Host Name (or IP address).
  • Under Saved Sessions, type in a relavent name and press the Save button to save.
    putty3

Run PuTTY

  • Double-click on the PuTTY session and login. A .Xauthority file will be generated.
  • to determine if the DISPLAY variable is set, in terminal type this command. <sourcecode>echo $DISPLAY</sourcecode>
  • To Start any X application, type in the name of the app. For example, Firefox or Gedit.

This has been tested and works with Red Hat Enterprise Linux 5.x using PuTTY Release 0.60 and Xming 6.9.0.31 on March 3, 2010.

Source: Arul’s Tech Info, Linux Toolkits and X11 over SSH.