X11 forwarding from a remote unix server

Supposed that you are already familiar with how to make X11 forwarding work from your PC to remote AIX server.

1. Make sure you have PuTTY installed on your PC before installing Xming. In your putty config, make sure you enable X11 forwarding in Connection->SSH ->X11.


2. Then on your PC run Xlaunch, and make sure to set your DISPLAY to a higher value, for example “10” and to check “No Access Control”.



3. Make sure you have X11Forwarding enabled in the sshd config. Your /etc/ssh/sshd_config should contain something like this:


X11DisplayOffset 10
X11Forwarding yes
X11UseLocalhost yes
XAuthLocation /usr/bin/X11/xauth

Restart sshd if you have to make the change to /etc/ssh/sshd_config:
stopsrc -s sshd ; startsrc -ssshd

4. Log in to the UNIX host through PuTTY.

Test, run xclock :

# xclock &

The program xclock should open on your window.

5. Now, how do you get around opening an X window if you have to go through a jumpserver first to get to the correct UNIX server, where you would like to start an X-based program? That’s not too difficult also. After logging in on the UNIX jumpserver, following the procedure described above, issue the following command:

# ssh -X -Y -C otherunixhost

Of course, replace “otherunixhost” with the hostname of the UNIX server you’d like to connect to through your jump server. Then, again, to test, run  “xclock” to test. It should open on your PC. Now you have X11 forwarding from a UNIX server, to a jumpserver, and back to your PC, in fact double X11 forwarding.

About Author