How to make a remote connection to an X Server using PuTTY on a Windows client

Home > Search > How-to
  by

Access control

On the X Display server, use the xhost + command to allow any client to connect to the X Display server.  

[root@server1 ~]# xhost +
access control disabled, clients can connect from any host

 

On the X Display server, use the xhost - command to deny any client to connect to the X Display server.  

[root@server1 ~]# xhost -
access control enabled, clients cannot connect from any host

 

You can also append specific computer hostnames or IP address to only allow or deny certain computers to be able to connect to the X Display server.

[root@server1 ~]# xhost + example.com

 

 


Ensure the OpenSSH server is configured to be able to display a graphical interface.

Ensure the /etc/ssh/sshd_config file on the OpenSSH server is configured to allow X11 sessions.

X11Forwarding    yes 
X11DisplayOffset 10 
X11UseLocalhost  yes

 

Assuming the client is a Windows machine, install Xming on Windows:

  1. Download Xming from http://sourceforge.net/projects/xming/files/latest/download
  2. Install Xming.
  3. Ensure Xming is active and running on Windows.

 

Configure PuTTY to use X11 forwarding:

  1. In the left panel of PuTTY, expand Connection > SSH, and select X11.
  2. Tick Enable X11 forwarding.
  3. Connect to the OpenSSH server.

 

Once connected, you will still have a non graphical display. However, you can start x programs. For example, the xclock command can be used to display the clock. The graphical clock will be displayed.

[root@server1 ~]# xclock



Add a Comment




We will never share your name or email with anyone. Enter your email if you would like to be notified when we respond to your comment.




Please enter in the box below so that we can be sure you are a human.




Comments