March 2, 2023

How To Configure X11 Forwarding On CentOs 7


For operating systems like Unix, the X11 Window System is a windowing system for bitmap displays. Using X11, you can  interact with a GUI environment. As a result, there is a wide range in the visual design of X11-based environments. Several programs may show dramatically different interfaces. This means that the executable itself is hosted on a different machine than the one on which the GUI is displayed. Then the  graphical windows are transmitted to your local machine via an SSH connection. In this guide we will see how to configure X11 forwarding for CentOs 7.


Steps To Install X11 On CentOs 7

At first lets install all the required packages using the given command in terminal. Once the installation is finished we can move forward.

# yum install -y xorg-x11-server-Xorg xorg-x11-xauth xorg-x11-apps

Steps To Configure x11 Forwarding On CentOS 7

In order to run the app over SSH we need to enable x11 in /etc/ssh/sshd_config file, to do so run the given command in terminal. Open the file and uncomment or add the given line X11Forwarding yes
and save the file.

# nano /etc/ssh/sshd_config



Once the file modification is finished restart the sshd service to apply the changes.

# systemctl restart sshd

Next we are going to install Xming on our windows PC which will render the GUI content of apps from the X11 server.

Verifying The Installation

Open Putty on your local PC and enable the x11 forwarding option and connect the server. On the server run any graphical tool and you will be presented with its GUI.


Configure x11


Once the X11 option is enabled in Putty we can run any GUI app and the x11 server will render its interface. In this example we are going to check eyes tool to verify the installation. To run the GUI interface for eyes enter the given command in terminal.

# xeyes




In this guide we learned how to configure X11 forwarding on CentOs 7. As a result we can now access GUI apps over SSH connection. Likewise the same installation steps applies for all other distros with basic command modification. However X11 forwarding should be enabled with caution. Users with the ability to bypass file permissions on the remote server can access the local X11 desktop through a forwarded connection. An attacker can then perform operations such as keystroke monitoring if the ForwardX11Trusted option is also enabled.

Buy Chep Dedicated Server @ $ 37.99/m Only.

Popular Blog Posts