Running Raspbian 20120715 (see below)

Current Operating System: Linux AllansPi 3.1.9+ #168 PREEMPT Sat Jul 14 18:56:31 BST 2012 armv6l

Using usb keyboard, mouse, HDMI monitor. Whenever I type startx at the $ prompt after login, screen blanks. System appears to hang, finally returns error message

"xauth: timeout in locking authority file /home/pi/.Xauthority "

BUT when I typed startx from Putty session, the normal screen display appeared on the monitor, normal GUI use was possible, using usb mouse and keyboard attached directly to the pi. Logged out correctly, closed down properly.

HOWEVER all subsequent attempts from prompt on monitor and/or via putty now return the error message "xauth: timeout in locking authority file /home/pi/.Xauthority "

Presumably the file .Xauthority is corrupted. How do I fix this....

Have tried Problems starting X this did not help, since my problem is different and I already have screen connected.

all advice gratefully accepted, but please keep it simple since I am a noob....

  • Adding the outputs of ls -l /home/pi/.Xauthority* and fuser /home/pi/.Xauthority would help guess.
    – XTL
    Commented Aug 27, 2012 at 6:38
  • Can you reformat this question to be a bit easier to read. I can't edit right now, as I'm on mobile internet. Commented Sep 22, 2012 at 11:35
  • Krzysztofs answer doesn't work for me D: Someone help me please.
    – user8234
    Commented Jun 29, 2013 at 10:30
  • I was having the same problem on Debian Wheezy x64 getting the same error and deleting the .Xauthority file worked for me.
    – user11111
    Commented Dec 8, 2013 at 22:14

2 Answers 2


One possible source of this problem can be file ownership. You could try running following command:

 sudo chown -R pi:pi /home/pi

This should change ownership of all files in pi directory (and all directories inside of it) back to the user pi and group pi.

xauth application has a commandline option -b which is intended to clean stale locks if they exists so you could also try running (when logged in as user pi):

 xauth -b

.Xauthority file is not needed when X session is not running so you could safely remove it and it will be recreated next time X is started. But the message does not seem to suggest the file is corrupted so I don't think this can solve your issue.

  • retry Problem solved - thanks Krzysztof. Not sure how to post a reply, so using "comment". xauth -b resulted in yet another error report. BUT deleting .Xauthority solved the problem, now working perfectly from local and via SSH Thanks again retry - apologies for truncated reply; timeout on comment cut me off@Krzysztof
    – AllanS
    Commented Aug 27, 2012 at 7:31
  • You could accept my answer (and maybe even upvote) then :) This way other people having similar problem will know that this one is worth trying even without reading the comments. That's how stackexchange is working. Commented Aug 27, 2012 at 7:35
  • Hello @AllanS and welcome to Raspberry Pi! You can accept someones' answer by clicking the little checkmark underneath the voting icons. For more info please read this. Thanks!
    – user46
    Commented Aug 27, 2012 at 11:45

I also had the same problem. I deleted all .Xauth* files from pi folder and it worked. May be .Xauth files be corrupted due to direct power off.

Not the answer you're looking for? Browse other questions tagged or ask your own question.