Site icon CentLinux

How to configure X11 Forwarding over SSH

Share on Social Media

Learn how to configure X11 Forwarding over SSH for remote graphical application access. Follow our step-by-step guide to securely display X11 applications from a remote server on your local machine. #centlinux #linux #ssh

What is X11 Forwarding?

X11 Forwarding is a feature of the X Window System (X11) that allows a user to run graphical applications on a remote server while displaying the application’s graphical interface on a local machine. This is typically achieved over a secure SSH (Secure Shell) connection. Here’s an overview of X11 Forwarding:

Key Concepts and Features

  1. Remote Application Execution:
    • X11 Forwarding allows applications to run on a remote server but display their graphical interface on a local client machine. This is particularly useful for accessing graphical applications from a remote location.
  2. Secure Connection:
    • By leveraging SSH, X11 Forwarding ensures that the data transmitted between the local and remote machines is encrypted, providing a secure method of accessing remote graphical applications.
  3. How It Works:
    • When X11 Forwarding is enabled, SSH sets up a secure tunnel between the local machine and the remote server. The remote application sends its graphical output through this tunnel, which the local X server then displays.
  4. Common Uses:
    • Useful for system administrators and developers who need to use graphical tools on remote servers.
    • Allows users to access and interact with GUI-based applications from a remote environment, such as accessing a graphical text editor, IDE, or other software.

Benefits

Potential Issues

X11 Forwarding is a powerful tool for remote system management and application access, providing a secure and convenient way to run graphical applications from a remote server.

Problem Statement

Usually, Graphical mode is turned off in Linux servers due to Security and Resource optimization. In such environments running a GUI application is not a trivial task. However, we can use PuTTY and XMing to forward X11 display to a windows client over SSH protocol.

In this article, we will first install required packages on our Linux Server, then we will configure X11 forwarding over SSH on windows by using PuTTY and XMing.

System Specification

One Microsoft Windows client and a Linux server.

Required Software

Download and Install following two software on Windows client.

PuTTY
XMing X Server for Windows

Install required packages on Linux server

Connect to Linux machine and install necessary packages for X11 forwarding.

# yum install -y xauth

We will require a Linux GUI application to test X11 forwarding configurations. Therefore, we are installing xclock to test the configuration.

# yum install -y xclock

Configure XMing

After installing Xming on Windows run xlaunch application.

Run XMing
XMing Display Settings

Default configuration will work for us. Therefore, click on Next.

XMing Session Type

Click on Next.

XMing Additional Parameters

Click on Next.

XMing Finish Configuration

Click on Finish.

XMing application has been started and it is placed in System Tray of Windows.

Configure PuTTY

Once installed, run PuTTY application.

Run PuTTY

Add a session of our Linux machine therein.

PuTTY Configuration 1

Besides other configuration, we are also required to configure X11 forwarding as follows:

PuTTY Configuration 2

Save and open the session.

login as: root
Authenticating with public key "rsa-key-20190101"
Last login: Tue Jan  1 21:16:23 2019 from 192.168.116.1
/usr/bin/xauth:  file /root/.Xauthority does not exist
# xclock

Xming will capture the Display open a window to run xclock application.

Linux xclock

Final Thoughts

Configuring X11 Forwarding over SSH can greatly enhance your ability to access and use remote graphical applications securely. If you need expert assistance with setting up X11 Forwarding or any other SSH configurations, I am here to help. Check out my Fiverr gig for professional and reliable services: Linux Admin Expert

Let’s ensure your remote access setup is secure and efficient!

Exit mobile version