CentOS SSH X11 Forwarding

To setup SSH X11 forwarding on CentOS, we need to:

1. On the remote server, edit /etc/ssh/sshd_config, and set the following values:

X11Forwarding yes
X11DisplayOffset 10
X11UseLocalhost yes

2. On the remote server, install the package xorg-x11-xauth:

# yum install xorg-x11-xauth

3. On the remote server, install the fontconfig packages:

# yum install fonts-xorg-base (CentOS 4)
# yum install xorg-x11-fonts-base liberation-fonts (CentOS 5)

4. Now login to the remote server using "-Y" option:

local$ ssh -Y remote_server

5. In the remote server, run your X program, such as the xterm:

remote$ xterm

And you shall see the X program pop up in your local desktop.

You can also add the following into your $HOME/.ssh/config:

ForwardAgent yes
ForwardX11 yes
ForwardX11Trusted yes