ssh: X11 Forwarding

One of the coolest uses of ssh I’ve had to use recently is the X11 forwarding. In my case I had a java application that opened up a GUI but I had to run it from a server that did not have a running graphical user environment as it was in init state 3.

The answer is far simpler than one would initially think. With the ssh client you are able to connect to a server and enable X11 forwarding. For me this meant I could connect to my server in init(3) via my local machine enabling X11 and launch the GUI.

To try it out yourself simply run

$ ssh -X [email protected]

Once you login kick off a GUI tool like firefox.

About Benjamin

Benjamin is a Infrastructure and Software Engineer. On this blog he writes about Linux, Docker, Programming as well as other Systems topics.

Learn more about Linux

If you liked this article, check out Benjamin's book: Red Hat Enterprise Linux Troubleshooting Guide. Where you can learn a lot more about troubleshooting Linux systems. This book is filled with tips and techniques he has learned over years of managing mission critical systems.