Sign up ×
Raspberry Pi Stack Exchange is a question and answer site for users and developers of hardware and software for Raspberry Pi. It's 100% free, no registration required.

Running Rasbian 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....

share|improve this question
Adding the outputs of ls -l /home/pi/.Xauthority* and fuser /home/pi/.Xauthority would help guess. – XTL Aug 27 '12 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. – bearbin Sep 22 '12 at 11:35
Krzysztofs answer doesn't work for me D: Someone help me please. – user8234 Jun 29 '13 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 Dec 8 '13 at 22:14

2 Answers 2

up vote 11 down vote accepted

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.

share|improve this answer
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 Aug 27 '12 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. – Krzysztof Adamski Aug 27 '12 at 7:35
Sorry Krzysztof. Not sure how to accept your answer. Is there a FAQ that explains how? Thanks again @Krzysztof – AllanS – AllanS Aug 27 '12 at 9:47
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 Aug 27 '12 at 11:45
Answer accepted. Thanks Brian, thanks again Krzysztof @Brian – AllanS Aug 27 '12 at 12:47

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.

share|improve this answer

protected by Community Dec 8 '13 at 22:33

Thank you for your interest in this question. Because it has attracted low-quality answers, posting an answer now requires 10 reputation on this site.

Would you like to answer one of these unanswered questions instead?

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