X11 Forwarding using SSH and PuTTY

In some cases, you need the capability of running an X server without installing an X server on your Linux machine. This can be done by utilizing the capability of SSH to forward X11 connections to a machine that runs an X server for Windows such as Hummingbird Exceed.

To start off, we need to install the packages we need for this to work. Run this command as root:

# yum -y install xorg-x11-server-Xorg.x86_64 xorg-x11-server-common.x86_64 xauth xterm openssh-server

After installing the packages, start configuring your Linux machine for X11 Forwarding.

1. Enable X11 Forwarding on SSH server by running the following commands as root:

# /bin/sed -i '/X11Forwarding/s/no/yes/' /etc/ssh/sshd_config
# /etc/init.d/sshd restart

2. Open another session and edit PuTTY profile to allow X11 forwarding. On your PuTTY configuration, go to Connection -> SSH -> X11 and tick the box Enable X11 forwarding.

3. In the X display location field, type localhost:0.0

4. Navigate back to Session and enter the hostname of your Linux machine. Click Open.

5. Login using your username and password. Once logged in, you may notice a message similar to this:

/usr/bin/xauth: creating new authority file /home/r19/.Xauthority

7. At this point, you will now be able to forward X11 to your desktop. Run your X11 server for Windows, in this example, we use Hummingbird Exceed.

8. Start any program that uses X11, xterm is a good program to use.

At this point, you should be able to see an X11 window on your Windows desktop.