How to Enable X11 Forwarding from Red Hat Enterprise Linux

What is X11 Forwarding?

X11 forwarding is a feature of Linux/Unix systems that allows you to run graphical applications on a remote Linux/Unix server and have them displayed through your local desktop environment. This is useful when you need to run graphical applications on a server that doesn’t have a desktop environment installed or if you need to access a remote server from a Windows machine that doesn’t have an X11 server installed. X11 forwarding works by forwarding X11 protocol packets from the remote Linux/Unix server to your local machine through an SSH tunnel, allowing you to run graphical applications remotely.

How to Enable X11 Forwarding from Red Hat Enterprise Linux

To enable X11 forwarding from Red Hat Enterprise Linux, follow these steps:

  1. Install Xming or any other X11 server on your Windows machine.
  2. Enable X11 forwarding in your SSH configuration file on the Red Hat Enterprise Linux server. To do this, open the SSH configuration file in a text editor, such as nano or vi, by running the following command:
sudo nano /etc/ssh/sshd_config
  1. Locate the line that says “X11Forwarding no” and change it to “X11Forwarding yes”. If the line doesn’t exist, add it to the end of the file. Save the file and exit the text editor.
  2. Restart the SSH service on the Red Hat Enterprise Linux server to apply the changes by running the following command:
sudo systemctl restart sshd
  1. Connect to the Red Hat Enterprise Linux server using SSH with X11 forwarding enabled by running the following command on your Windows machine:
ssh -X username@redhat-enterprise-linux-server
  1. Once you are connected to the server, you can test X11 forwarding by running a graphical application, such as xclock or xeyes, in the SSH session. For example, to run xclock, simply type the following command in the SSH session:
xclock
  1. The xclock application should now run on your Windows machine, displayed through the X11 server.
Visited 93 times, 1 visit(s) today

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top