I just rebooted on my 20.04 Ubuntu (that I have been using since 2 months now) so nothing really new or changed and as far as I know also no updates either.

But after this reboot I can't (stay) logged in. I try to login with the correct password.. it logs in. And the immediately goes back to the login screen. I tried a wrong password.. and then it says something was wrong (ofcourse the password) also when I want to reboot again. It actually says I am still logged in. Never the less I can't get to the desktop.

Anyone that has any experience with anything like this? I tried all the keys on the keyboard. None is stuck either. Is there a logout shortcut key I can specially look at?

Also is there a possibility to login / boot into a basic option into a terminal by passing the issue? As for now I really can't do anything to check or solve the issue.

Kind regards

@heynnema & Prakhar:

Thanks for your replies. Indeed I have found that the issue is a common one. I tried both your solutions.. but it doesn't work. Both .Xauthority and ICEauthority are in name of me (user) and not root.

Also I did not use sudo to access a GUI. It's been a while since I rebooted the machine but I don't recall doing that at all. Also I googled some options and tried all this


None of it worked for me..

I now indeed installed lightDM. Following huux :answer' Login loop with fresh 19.10 install

I can now log in but I get an 2nd error on login about a colour profile.that I can seem to get past except by pressing cancel..

At least nog i have a change to Google a more permanent solution and still work on.


4 Answers 4


I have faced this issue a couple of times and this bug is famously known as 'Ubuntu Login Loop.'

You can get a lot of answers when you google it.

I solved it by doing the following.

  1. Press ctrl+alt+F1 or Fn+Ctrl+Alt+F1 to enter tty1.
  2. Login using your credentials.
  3. rm or mv the file called .Xauthority


If it still doesn't work, drop to root shell (from recovery mode at startup) then install another display manager like lightdm, gdm, lxde etc.

Nice day!

  • No reason to install another DM.
    – heynnema
    Jun 21, 2020 at 18:25

If suggestion by @Prakhar is not working than the possible cause is that your configuration is somehow set to have a very low timeout for lockscreen.
If the timeout is set to 1 minute or even less then this was the problem I faced. But setting that too low timeout can't be done from GUI setting so directly look at configuration file from another tty.
Do not forget to check the log generated by Xorg and systemd too ( as it might be even deeper issue ). Also try to logging into another tty as root then killing Xorg and manually starting(though it will automitically start afetr getting killed).
Also check the permission for /tmp and Xorg related file


I had this problem and tried all the things you did. The culprit turned out to be a very long environment variable. My LS_COLORS env var was over 9000 characters long as is was generated from a dircolors database. As soon as I removed it I could log in again. In /var/log/syslog I was getting a segfault in libpcre.so.3.13.3. That env var must have been causing gdm to crash which is why it looped back to login again.

  • 1
    thank you for this answer. but i had to get it to work sooner so i did a comple fresh install. unfortunetaly now i can't check anymore is your answers could've worked, none the less. thanks very much i hope it helps other people Jul 18, 2020 at 19:31
  • @Paul Thanks for sharing. I am facing the same issue. How to remove LS_COLORS env variable ?. Doing this will have any side effects ?
    – Private
    Mar 15, 2021 at 20:15

I also ran into this issue. Weirdly enough, the only thing I had to do to fix it was to restart the NUC I had it running on, open the boot menu, then launch into the ubuntu partition.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .