One of the more common and arguably most frustrating bugs experienced by Ubuntu users is the login boot loop. When you try to log in to Ubuntu after starting up, you get taken right back around to the same login screen, and the process repeats indefinitely.
It might seem like you’re out of luck, but there are a couple of ways to break the loop. The most common cause is a strange permission issue with a file Ubuntu needs to start the graphical desktop. You can work your way around it by entering the command line shell and correcting the file permission. It’s a quick fix, and it works in most cases.
Log in to the Shell
Start Ubuntu like you normally would. Let it get all the way to the login screen. When you get there, don’t sign in. Instead, press Ctrl + Alt+F3 on your keyboard. Ubuntu will drop out of the graphical login screen and into a black and white terminal.
Enter your username in the prompt, then provide your password when asked. You’ll arrive in a familiar-looking terminal screen. You can navigate here exactly like you do in your graphical terminal windows.
Check the Permissions of Xauthority
The file that you need to check is in the root of your “/home” folder. After logging in, you should already be there. The file is a hidden “dot file,” so you’re going to need to use the right flags when looking it up. Search using
grep in the following command.
You should see the file listed with the permissions first, followed by the username and group that own it. If you see “root” listed there, you’ve found the source of the problem.
Change the Permissions of Xauthority
Now that you know what’s causing the problem, it’s time to set it right. Instead of root, your user and group should own that Xauthority file. You can change the ownership by running the
chown command with sudo.
That should go off without a hitch, so you’re ready to try logging in again. Press Ctrl + Alt + F7 to return to your normal login screen. Log in to Ubuntu!
If that didn’t work or your Xresources file was owned by your regular user, you have a couple of other options to try. These aren’t necessarily guaranteed either, but they’re worth a try.
Change “/tmp” permissions
Sometimes the “/tmp” folder, which stores the temporary files your computer is working on, experiences the exact same issue as the Xauthority folder. The process of fixing it is very similar.
Go ahead and log in to the terminal again. Then, check the permissions of “/tmp.”
You’re looking at the permissions for the top entry, the single “.” If they look like “drwxrwxrwt,” you’re okay. If not, you should reset them to that state with
chmod and sudo.
Change Display Manager
Finally, when all else fails, you can try switching your display manager. This was a much more common issue prior to Ubuntu 17.10 when it switched to GNOME and GDM for logins. Still, on some versions of Ubuntu LightDM is the standard. On the other hand, if you’re using GNOME and GDM, you can try LightDM. Log in to the terminal again. From there, install the display manager you want to try. During the install Ubuntu will ask you if you want to switch. Agree to this.
With any luck, one of these methods solved the problem, and you’re able to log in to Ubuntu as usual.