How configure X11 Forwarding in CentOS/RHEL 6/7

Thanks to Techoism

X11 forwarding refers to executing such a program remotely through an SSH (Secure Shell) connection. It’s mean the executable file itself is hosted on a different machine than where the graphical interface is being displayed. The graphical windows are forwarded to your local machine through the SSH connection.

Step 1: Install Required Packages

First install the required packages using below command.

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

Step 2: Enable X11 Fowarding

After installing the required packages enable the X11 from ssh configuration file.

# vim /etc/ssh/sshd_config

Uncomment or add the below lines.

X11Forwarding yes

Step 3: Restart SSH Service

Once the config file’s modifications have been made to your Linux system, the SSH service will need to be restarted to effect the revised configuration.

For CentOS/RHEL 7
# systemctl restart sshd
For CentOS/RHEL 6
# service sshd restart

Step 4: Test Connection

Now verify the connection using below command.

Access Putty
Enable X11 in Putty, before login.

Enable X11

Run below command to test the connection.

# xclock&


# xeyes&


Enjoy it!

Note: One more thing when you disabled the ipv6 on the system you also need to do changes under to change “AddressFamily any” to “AddressFamily inet” in /etc/ssh/sshd_config and restart ssh.

Hi All, I like to spend time on black and white screen with linux. I love to learn new things in linux specially in virtualization. Currently I am working on OpenStack like to dig deep.

Posted in Linux

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: