X11-FORWARDING

X11-Forwarding is a secure shell feature, which allows one to forward/tunnel X11 connections through an existing SSH session. This is used to run X11 programs on a server while the ssh-client displays the graphical window through the user’s X11-server. 0

Dependencies

In most cases, you will already have the required dependencies. At minimum, ensure that you have the following installed:

$ kiss b xorg-server
$ kiss i xorg-server
$ kiss b xauth
$ kiss i xauth

Remote Server Configuration

Configuring X11-Forwarding for a remote server is straightfoward and, once completed, a viable alternative to most opensource VNC and RDP server options. All that is required are a few modifications to configuration files that exist on your remote X server:

$ echo "XauthLocation /usr/bin/xauth" >> /etc/ssh/sshd_config
$ echo "X11Fordwarding yes" >> /etc/ssh/sshd_config

At this point you are ready to test your server!

Client Configuration

In order to connect to your remote server, you will need an SSH client that supports X11-Forwarding, as well as an X server running on the same client. Some popular cross-platform options include the following:

From the client side, connect to the server via SSH through your favorite terminal application while passing the “-X” switch. Pay attention to any errors that may occur on connection. More verbose output can be achieved by passing the “-v” switch:

$ ssh -X -v user@localhost

You can now start any X program on the remote server, the output will be forwarded to your local session:

$ xclock

This should create a new window with the xclock application on your client side X server.

Use an “&” at the end of the command to prevent tying up the terminal in question:

$ xclock &

Tips and Tricks