How to resolve Infinite Login Loop in Ubuntu?

What is a Infinite Login Loop Error?

Trying to login in your account from login panel of Ubuntu, you are again redirected to the same login interface after you enter your password. Again after you enter your password, same screen will be displayed again and again infinitely. We call this error as Infinite Login Loop Error.

There are few possible reasons for causing this Infinite Login Loop. They are:

  • Possible damage of some packages.
    Infinite Login Loop can occur if the last operation you performed in your system was updating various packages, but they got interrupted while downloading. There are some steps which can fix the infinite login loop.
    • Go to runlevel 1: Ctl Alt F1
    • login with user-name and password.
    • Run updates "sudo apt-get update"
    • Check all applications "sudo apt-get upgrade"
    • Check all packages "sudo apt-get -f install"
    • Update grub "sudo update-grub"
    • Remove all old applications and packages "sudo apt-get autoremove"
    • Reboot "sudo reboot" 

  • .Xauthority file chown (change owner) error.
    Sometimes if there are different users in your system and your system assigns the .Xauthority file to root users ( By default the permission is allowed to root only ) then  the users except root may face this Infinite Login Loop Error. .Xauthority file saves cookies and information realted to the login session and various applications after the user is logged in. So now in order to get rid of this error you need to change the owner of the system to your username.
    1. At the login screen enter runlevel 3 by pressing CTRL+ALT+F3
    2.  type ls -lah to look for the .Xauthority file and its privileges.
      You will see thir kind of ourput in the list:
      -rw------- 1 root root 53 Nov 29 10:19 .Xauthority
    3. then type sudo chown 'username':'username' .Xauthority, replacing the username with your username. Now you are able to access the .Xauthority file and all your login information after you login to your system will be stored in this file.
    4. Then reboot your system.
      sudo reboot


EmoticonEmoticon