X11 over Secure Shell

When I first started using Slackware Linux, I struggled to find answers to why my “ssh -X node” wouldn’t work. I was sent on a wild goose chase for about a year. Finally, I found the solution to my problem.

First, modify the server side secure shell configuration found in /etc/ssh/sshd_config. There are a couple of options you will need to modify in order to allow X11 over SSH.

In the following example, my client and server are two different nodes. So if you want to enable X11 over SSH on both sides, make sure you make client-side and server-side changes for each node.

#X11Forwarding no
#X11DisplayOffset 10

You’ll want to change that default setting to the following, ensuring that you remove the # comment as well:

X11Forwarding yes
X11DisplayOffset 10 

Next, you’ll want to configure your client side settings in /etc/ssh/ssh_config.

#ForwardX11 no

And change this to, again, don’t forget to remove the comment:

ForwardX11Trusted yes

Finally, restart the server side ssh daemon using the following command:

# /etc/rc.d/rc.sshd restart


I would recommend making a script that will automate these changes, because sometimes the slackpkg manager will install a new configuration file for either of the client/server side services. Pay attention to those messages when using slackpkg to ensure you don’t over-write configuration files you’ve already manipulated!


Leave a Reply

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

WordPress.com Logo

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

Google+ photo

You are commenting using your Google+ 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