[CentOS] X11 connection rejected because of wrong authentication

Mon Nov 25 11:15:36 UTC 2013
Timothy Murphy <gayleard at eircom.net>

James Hogarth wrote:

>> I'd like to run SELinux on my CentOS server in enforcing mode,
>> but I get the above message when I run sealert.
>> I assume this is because I am accessing the server from my laptop?
>> Am I right in thinking the message arises from my remote connection?
>> And if so, is there a simple solution?

> Too little information at present to tell.
> Does it work if the system is in permissive?

The CentOS server is running with SELinux in permissive mode.
I would prefer to run it in enforcing mode,
and to that end would like to solve the problem above.

> Did you ever have the system in disabled and then switched to
> permissive/enforcing?

No, CentOS-6.4 was recently installed,
and the system has always been in permissive mode.

> Do you have xauth installed?

This is the response to "yum install xauth":
Package 1:xorg-x11-xauth-1.0.2-7.1.el6.x86_64 already installed 
  and latest version

> 9 times out of 10 with this message it's just that 
> there is no (or incorrect) .Xauthority 
> so the X server rightfully denies the untrusted connection.

On the server
[tim at grover ~]$ ls -lsZ .Xauthority 
-rw-------. tim tim unconfined_u:object_r:xauth_home_t:s0 .Xauthority
Same on the connecting laptop
[tim at rose ~]$ ls -lsZ .Xauthority 
-rw-------. tim tim unconfined_u:object_r:xauth_home_t:s0 .Xauthority
Incidentally, if there was something wrong with .Xauthority
shouldn't sealert point this out?

Timothy Murphy  
e-mail: gayleard /at/ eircom.net
School of Mathematics, Trinity College, Dublin 2, Ireland