Ubuntu: Login loop

One day you reboot your Ubuntu machine after some automatical updates and you are not able to log in. Your credentials obviously works, but a few seconds after enrering them you are back on login screen. Welcome in Login Loop Hell.

You probably try to search for help and find tips like this or this or this with plenty of options. You try all of them but none works.

So I will suggest two more 😉 Maybe you should start with them because they are way easier than commandline tricks.

1. Try to use another environment

Before entering credentials, try to switch to another environment:

select environment

If problem is caused by something environment specific then you will be able to log in into UI and investigate or update.

2. Try to create new user account

Log in into terminal (CTRL+ALT+F1) and create alternative account:

sudo adduser test

Now try to log in via this new user “test”. If it works (my case) then there is something wrong with your profile. In my case extension “workspace-grid” was the culprit. But you have to find what is your culprit. I am afraid thay you will need to use Bisection method:

  1. Login as another user with high rights (sudo su -)

  2. In your home folder create folder like “TODO”

  3. Move all files and folders (you may first try to move only .local) of your home into TODO (do not forget to move hidden files and folders starting by dot)

  4. Move half of files from TODO back into HOME and try to log in

  5. If it works, goto 4. unless it is empty. If it does not work move half of previously moved files back into TODO. And check login again.

By this method you should find root cause. In my case in folder /home/jarek/.local/share/gnome-shell/extensions/workspace-grid@mathematical.coffee.gmail.com. I just updated that extension manually and it worked like charm.

I hope this methods will be helpfull.

Tags:  Ubuntu  linux