How To Enable X11 Forwarding in RHEL 8 / Centos 8
X11 is very important for a sysadmin because some applications only install or run on GUI. This always happen in case of third party applications. So in this article, we are talking about how to use x11 forwarding.
This is an awesome tool for every sysadmin who is working remotely via putty and need to work or install GUI applications.
Mostly cases we use it on java and KVM applications with the help of x11.
If you are using it on the remote machine do not set any environment variable. Just enable x11 forwarding in ssh setting in putty and follow the below steps.
What is X11?
X11 is the final or 11th version of x windows system .Mostly places we see x window and in Linux we see x11.
In this system, a program or we can say, x client display graphics on our localhost or windows computer and run on the remote machine. And receives its input from the screen for the remote machine.
In Linux when we are working on the remote machine via putty and we required to work on any graphical application we use x11 forwarding on the Linux machine.
X11 Forwarding is Secure?
The secure shell has the feature of x11 forwarding. So our all data travel from ssh to localhost. Then we can say x11 forwarding is secure as ssh connection is secure.
How To Enable X11 Forwarding in Linux?
Step-1 Install requires packages
# yum install xterm xorg-x11-xauth xorg-x11-fonts-* xorg-x11-utils -y
Step-2 Change the ssh configuration file for X11
We need to do changes to access the GUI application over ssh. Search Address family and unhash and change it as below:
#Port 22 AddressFamily inet #ListenAddress 0.0.0.0 #ListenAddress ::
Search X11Forwarding and unhash it. Do not change any other setting or environment variable.
X11Forwarding yes
Step-3 Restart ssh
Restart ssh daemon for apply changes
# systemctl restart sshd
Step-4 You need an Application
You need to install xming or any application where putty forward x11 requests and display graphics.
You can check by type xterm application.
# xterm
This will open the application in GUI mode in your x display application
Now at this point, you have successfully configured x11 to use the graphical application on putty.
Share the article if found helpful.