Linux “X11 Connection Rejected Because of Wrong Authentication” Error and Solution – POFTUT

Linux “X11 Connection Rejected Because of Wrong Authentication” Error and Solution

I have set up X desktop and want to connect to the X server through ssh. As you know ssh provides X forwarding which is a very useful feature and used a lot of system administrators.

Try To Connect Ssh X Forwarding

We will try to connect the X service of remote ssh server by providing -X parameter.

OR

Try To Connect Ssh X Forwarding

Try To Connect Ssh X Forwarding

We get an error like “Unable to init server: Could not connect: Connection refused” or  “/usr/bin/xauth:  /home/ismail/.Xauthority not writable, changes will be ignored”

Change Ownership Of Xauthority

We will change Xauthority file ownership because it will be used by the current user to read and write.

Change Ownership Of Xauthority

Change Ownership Of Xauthority

Check Disk If It Is Full

One of the root cause of a lot of problems is fulling disk. It is a hidden problem and generally does not show himself. We should all ways count this option for troubleshooting.

df -lh

As we can see in the third line of output our root path have enough free space to run X

Check Ssh Server X Forwarding Setting

The ssh server configuration has a line X11Forwarding which enables or disable X11 forwarding. It may be disabled because of security reasons.

X11Forward

Check Ssh Client ForwardX11 Setting

The client-side of the ssh configuration also includes X11 forwarding. It shouldn’t be disabled or explicitly enabled like below.

LEARN MORE  Introduction To Ansible Tutorial

Check Ssh Client ForwardX11 Setting

Check Ssh Client ForwardX11 Setting

We should uncomment line ForwardX11 no and change to yes.

Leave a Reply

Your email address will not be published. Required fields are marked *

Enjoy this blog? Please spread the word :)