Linux X11 Connection Rejected Because of Wrong Authentication Error and Solution


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

Try To Connect Ssh X Forwarding

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


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 ownerhsip because it will used by the current user to read and write.


Check Disk If It Is Full

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

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

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


Check Ssh Client ForwardX11 Setting

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


We should uncomment line ForwardX11 no and change to yes.

LEARN MORE  How To Generate and Configure Htpasswd Password In Linux For Apache and Nginx Server?

You may also like...

Leave a Reply

Your email address will not be published.

Enjoy this blog? Please spread the word :)