X11 forwarding enables the execution of a GUI (Graphic User Interface) program on a Linux/Unix server, even if the server is normally only available remotely via command line. This is accomplished by forwarding the display environment of the server to your localhost through an X11 tunnel.
Below is an example of how to enable and configure X11 forwarding on a Windows client:
- Download and install PuTTY. It is freely available for download here.
- Download and install Xming. It is freely available for download here.
- Start Xming if it is not already running.
- Start PuTTY and enter the Host Name or IP address of the server but do not connect yet. On the left, expand on the "Connection" node, expand the "SSH" node, and select the "X11" node. Check the box labelled "Enable X11 forwarding". Finally connect to the server by clicking the "Open" button.
- Once logged into the server, verify that the XAuth package is installed. The command to check the package will vary by Linux/Unix distribution. On Red Hat the command is "rpm -qa | grep xauth". The XAuth package is usually required for X11 forwarding.
- Install the XAuth package if it isn't already installed. Again the command to install the package will vary by Linux/Unix distribution. On Red Hat the command is "yum -y install xorg-x11-xauth". Root privileges are required to install the package.
- Verify that X11 forwarding is enabled in the file "/etc/ssh/sshd_config". Open the file and search for a line that reads "X11Forwarding yes". If the line is missing then add it; if the value is "no" then change it to "yes". Root privileges are required to open the file.
- Finally, execute the command that requires a GUI interface. After you execute the command Xming should launch the GUI program in a new window.