Your cart is currently empty!
How to Fix the Ubuntu Login Loop
The Ubuntu login loop is frustrating. You enter your password, hit enter—and you’re sent right back to the login screen. No error, no clue what’s wrong. Here’s how to actually fix it.
1. Understand What Causes the Login Loop
Before you fix anything, know the usual suspects:
- Full disk: Your system partition is out of space.
- Wrong permissions: Key files and folders have the wrong ownership or permissions.
- Corrupted .Xauthority: This file controls X session permissions.
- Broken drivers: Especially with graphics, things can go sideways after updates.
2. Get to the Terminal
When stuck in the loop:
- Press
Ctrl + Alt + F3
(or F2–F6). - Log in with your username and password.
3. Check Disk Space
Run:
df -h
If /
(root) or /home
is at 100%, clear some space:
sudo apt clean
rm -rf ~/.cache/thumbnails/*
Remove large, unnecessary files from your home directory.
4. Fix File Permissions
Reset your home folder ownership:
sudo chown username:username /home/username
sudo chmod 755 /home/username
Replace username
with your real username.
5. Remove the .Xauthority File
A corrupted .Xauthority
is a top cause:
rm ~/.Xauthority
Don’t worry—Ubuntu will recreate it.
6. Reinstall Display Manager
GDM, LightDM, and SDDM are common display managers. If you use Ubuntu default (GDM), run:
sudo apt update
sudo apt install --reinstall gdm3
sudo systemctl restart gdm3
For LightDM:
sudo apt install --reinstall lightdm
sudo systemctl restart lightdm
7. Check for Broken Drivers
Especially after a kernel or NVIDIA/AMD driver update. Run:
sudo ubuntu-drivers autoinstall
sudo reboot
8. Final Step: Reboot
After all this, restart your machine:
sudo reboot
Try logging in. If it still fails, check /var/log/Xorg.0.log
for more errors:
cat /var/log/Xorg.0.log | grep EE
Quick Recap
- Log in to terminal (Ctrl+Alt+F3)
- Free up disk space
- Fix permissions
- Delete
.Xauthority
- Reinstall display manager
- Update drivers
Still Stuck?
If you’re still looping, you might have a deeper config or hardware issue. Try creating a new user from the terminal and see if that works:
sudo adduser testuser
Log in with the new user to isolate the problem.
Got it working? Let me know in the comments what fixed it for you—or if you need more help!
Tech enthusiast and content creator passionate about making technology simple for everyone. I share practical tips, guides, and reviews on the latest in computers, software, and gadgets. Let’s explore the digital world together!