Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have lubuntu 12.04, and it was working fine until I installed something and I do not remember exactly what I installed because I was trying to build a ruby gem and it required a lot.

now I rebooted and I cannot log in, well, I can but when I do LXDE apparently cannot continue and returns to the login screen.

I created another user from my console screen (I can login there), and the other user can login. So I removed my .* directories from my home directory, but it did not help.

Any suggestions?

share|improve this question
possible duplicate of Ubuntu gets stuck in a Login Loop – Eric Carvalho Dec 29 '14 at 14:19
up vote 12 down vote accepted

In my case the cause was that ~/.Xauthority was owned by root.


$ ls -l ~/.Xauthority
-rw------- 1 root root 61 Sep 16 15:43 .Xauthority
$ chown group:user ~/.Xauthority
where 'group' and 'user' are the group and the user that you use to login. in my case:
$ chown akonsu:akonsu ~/.Xauthority

share|improve this answer
If you could add the commands you used to fix this it could help the next person who has this problem! – Jorge Castro Sep 16 '12 at 19:31
Great, thank you!!! – Antonio Petricca Mar 2 at 11:52

I just had the same problem with an upgrade to 12.10. It turns out that the ownership of the files in home had been switched, probably because I used my normal login account when I did the upgrade. i.e.,

all the files in /home/administrator had ownership of {name}:{name}
all the files in /home/{name} had ownership of administrator:administrator

My guess? The account numbers (1001/1002 iirc) had been switched.

Anyway, I ran the following:

sudo chown -R administrator:administrator /home/administrator
sudo chown -R {name}:{name} /home/{name}

where {name} is the name of the account (redacted to protect the innocent)

share|improve this answer
Please, keep one of the two chowns, it can confuse people... – jmendeth Nov 22 '12 at 15:32

This worked for me (12.10 Lubuntu - can login as guest fine, but logging in as self just keep getting returned to the login screen):

  1. Ctrl + Alt + F1 to get to terminal
  2. sudo passwd > to change password
  3. sudo apt-get install --reinstall xorg
  4. I still can't login at this point, so back to terminal
  5. cd /home/<user> (I think that cd ~ will get you to the same place, instead of type the name of your directory)
  6. sudo mv .Xauthority .XauthorityBak (renaming this file, I don't know why)
  7. Now it works :)

I think the problem may have been caused when I accidentally killed an X-Server process in the Task Mngr before logging out

See also Login screen loops unless you login as Guest

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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