View Full Version : Using SSH and X: X11 connection rejected because of wrong authentication.
joehill
January 19th, 2006, 02:39 AM
Hi,
I've been using ssh to log in from my laptop (running Ubuntu Breezy) to my server (running Kubuntu Breezy) and run various programs remotely in X-windows, but suddenly I'm getting error messages when I try to do that. If I run a GTK/gnome application it give me this error:
X11 connection rejected because of wrong authentication.
X connection to localhost:10.0 broken (explicit kill or server shutdown).
or this one:
X11 connection rejected because of wrong authentication.
The application 'gedit' lost its connection to the display localhost:10.0;
most likely the X server was shut down or you killed/destroyed
the application.
If I run KDE/Qt applications I get this error:
X11 connection rejected because of wrong authentication.
: Fatal IO error: client killed
A while back I tried rebooting the server and everything worked fine again for about a day, and then the problem came back. I at first thought it was a problem with my home directory but it's the same whether I'm running as root or any other user.
I'd appreciate any help I can get on this.
Thanks, Joe
joehill
January 20th, 2006, 12:17 AM
Well, I ended up rebooting again and it fixed the problem again for now. After reading a post on another forum by someone who had the same problem because of low disk space, I checked my "/" partition, which was somewhat low on space (down to 330 MB--which I would think is plenty but these days things take a lot of space) and I moved some stuff to another partition and it's been working since then. I'm crossing my fingers that this was the problem, but we'll see.
Joe
noob_Lance
January 20th, 2006, 07:13 AM
how did you get the C to display? i still cant figure that out for the life of me..
joehill
January 24th, 2006, 03:43 PM
What do you mean by "C"?
noob_Lance
January 25th, 2006, 06:40 AM
sorry.... i ment to hit X
joehill
January 25th, 2006, 06:03 PM
Do you mean how did I get the server to forward X information to the client? If so, you do "ssh -X me@myhost.mydomain.net." That's the option that specifies to forward the X connection and not just the terminal text. If that doesn't work you can use -Y instead of -X, which is for forwarding over a trusted connection (apparently less secure than -X, I'm not sure exactly what the implications of this are). Does this answer your question?
kiwigander
January 25th, 2006, 08:46 PM
As an alternative, you can edit the /etc/ssh/ssh_config file on the client so it contains the line
Forward X11 yes
(I believe the stock Ubuntu Breezy installation starts off with that line as
# Forward X11 no
so I assume that the default setting is "no".)
joehill
January 26th, 2006, 05:27 AM
Ok, that's simpler. Thanks for the pointer.
noob_Lance
January 27th, 2006, 09:06 AM
it is set to yes and even when i tried the -X or -Y it still did not work for me..
MJN
January 27th, 2006, 09:15 AM
It also needs enabling in your server...
X11Forwarding YES
..?
noob_Lance
January 27th, 2006, 09:30 AM
yes it is enabled on my server..
hil
August 10th, 2006, 02:07 AM
I got exactly the same problem here. I can't ssh to the ubuntu 6.06 server
my command: ssh -l h -Y 192.168.12.5
X11 connection rejected because of wrong authentication.
The application 'gedit' lost its connection to the display localhost:10.0;
most likely the X server was shut down or you killed/destroyed
the application.
hil
August 10th, 2006, 03:01 AM
I posted a solution to another page (http://ubuntuforums.org/showthread.php?p=1361790#post1361790)
Please take a look and see if that helps:confused:
mirak63
August 16th, 2006, 10:25 AM
I needed to put x11forward yes in /etc/ssh/ssh_config
This allow connecting clients to do ssh forwarding.
I though it would be in sshd_config but it was already on yes.
mohnkern
June 29th, 2007, 01:51 PM
I saw this same problem, and have a different issue. I thought I'd put it here for documentation.
Somehow my .Xauthority file on my computer on my home box got its ownership changed.
doing:
sudo rm $home/.Xauthority*
and then logging out and back in resolved the issue.
gulincho
July 3rd, 2007, 09:03 AM
For me, the problem was:
No space left on device (28)
I cleaned up /usr/cache/apt/archives.
bankg3
August 6th, 2007, 02:06 PM
I had a similar problem but my .Xauthority file wasn't the issue. When I first would ssh into my box I would get this message
sh: /usr/bin/xauth: Permission denied
so I checked my xauth file and the permissions were wrong.
-rwxr--r-- 1 root root 28K 2006-01-04 22:43 xauth
I changed the permissions "sudo chmod 755 /usr/bin/xauth" so I could execute the file and then everything worked ok. The next time I logged in a new .Xauthority file was created and everything worked.
dgavenda
December 20th, 2007, 09:12 AM
doing:
sudo rm $home/.Xauthority*
and then logging out and back in resolved the issue.
Worked for me too!!
alonsorm77
December 27th, 2007, 12:53 PM
Hello Guys!
I experimented the same problem, then i realized that i was working with big files, i erased some of them and the problem was corrected.
Is the HD space!
Thanks
jis
February 3rd, 2008, 01:39 PM
Worked for me too!!
It worked for me, too. I had three files: .Xauthority, .Xauthority-c and .Xauthority-l. I moved them to a subdirectory in case I need them later. When I logged back, a new .Xauthority file was created with different ownership.
MJN
February 4th, 2008, 06:59 AM
This can often happen (i.e. .XAuthority ownership changes to root) if you start X using sudo.
Mathew
vBulletin® v3.8.1, Copyright ©2000-2009, Jelsoft Enterprises Ltd.