Wednesday, June 17, 2009

X11 forwarding over SSH in Slackware

SSH is a program for logging into a remote machine and for executing commands on a remote machine. It is possible to run X Window graphical applications over SSH also. X forwarding allows you to run remote X applications that open their windows on your local display.

To establish an X Window connection over SSH:

1. Make sure that openssh package has installed and ssh service is active on both server and client machines.(OpenSSH is free version of SSH)

6. After logging into remote machine, execute below command to check the value of display variable in remote host environment.

echo $DISPLAY

If you do not see anything when typing above command, set value by executing:

export DISPLAY=localhost:10.0

Now try to launch an X application on remote machine from client machine, for example:

xlogo &

* /etc/ssh/sshd_config and/etc/ssh/ssh_config files have required lines for X11 forwarding in commented form as system default. Instead of adding new lines, just uncomment related lines and check parameters.

* You need to open port "22" on remote network for WAN connections over SSH.