Business News Daily provides resources, advice and product reviews to drive business growth. Our mission is to equip business owners with the knowledge and confidence to make informed decisions. As part of that, we recommend products and services for their success.
We collaborate with business-to-business vendors, connecting them with potential buyers. In some cases, we earn commissions when sales are made through our referrals. These financial relationships support our content but do not dictate our recommendations. Our editorial team independently evaluates products based on thousands of hours of research. We are committed to providing trustworthy advice for businesses. Learn more about our full process and see who our partners are here.
Learn all about the commands and programs you'll use to set up X11 forwarding – and the security risks it entails.
Tech-savvy users know you can easily connect to a Linux server using various secure shell (SSH) clients. If you prefer – or are required – to use a tool with a graphical user interface (GUI), the solution is X11 forwarding.
X11 forwarding is a mechanism that allows a user to start up remote applications, and then forward the application display to their local Windows machine. It enables you to run GUIs from a local server. It’s essentially remote desktop software that looks better on your screen and is easier to work with.
To set up X11 forwarding on Linux, you’ll need to perform functions on both the Linux machine and the Windows desktop.
You first need to make a few minor changes to your Linux machine to enable X11 forwarding. In this example, we’ll use a standard CentOS 6.5 installation with GNOME installed. Other Linux distributions will have a very similar SSH daemon configuration.
X11Forwarding yes
X11UseForwarding yes
service sshd restart
yum -y install xeyes
service iptables stop
The first requirement on the Windows guest is to install PuTTY, which provides the mechanism to forward the display data between the host (the Linux server) and guest (your Windows machine).
xeyes
Hopefully, a silly pair of eyes like this one will appear that follow your cursor around the screen.
To keep the terminal available for additional commands after you launch the X11-forwarded application, use an ampersand (&) at the end of the command to prevent tying up the terminal in question.
No matter which GUI you use on your Linux host – GNOME or KDE – both have an xdisplay manager that underlies the GUI portion of the display. The xdisplay manager is a network protocol designed to allow items to be forwarded to whichever destination that’s required.
X11 forwarding on a Mac is just as easy as installing it for Linux.
ssh -X root@mylinuxhost
X11 forwarding is safe if you’re confident the server is fully secure. Otherwise, you could be introducing cybersecurity risks. X11 forwarding gives a server all of your information without any protection.
X11 uses port 6000, though some systems use port 6001. Others may involve additional ports; however, such systems are relatively rare.
The X11UseLocalhost command connects your X11 forwarding server to either the wildcard address or loopback address. Without this command, your forwarding will automatically be linked to the loopback address.
To become more proficient with IT to help your company run more smoothly or boost your tech career, below are three articles that can help you find appropriate IT certifications:
To learn more about working with Windows Server, check out this resource.
Max Freedman contributed to the writing and research in this article.