A login loop means authentication succeeded but the graphical session failed to start. The classic causes are a full root or home disk, wrong ownership on .Xauthority or the home folder itself (often after running graphical apps with sudo), a broken graphics driver, or a corrupted session file. Do not reinstall Ubuntu first - in most cases you can fix this in a TTY console in a few minutes without losing any files.
X You are sure the password is correct - it is accepted, then rejected back to login
X Caps Lock and keyboard layout are already checked
X The same loop happens on every login attempt
X Logging in on a text console (TTY) still works
LOGIN LOOP The session crashes on start. It is almost never a password problem - read the disk space and file ownership first.
The fingerprint of this problem: the password is accepted, the desktop never loads, and you land back at login.
A completely full disk is the number one cause: the session cannot write its temporary files, so it exits at once.
df -h and look at the line mounted on / and on /home if separate. If Use% shows 100%, free space before anything else.sudo apt clean, then sudo journalctl --vacuum-time=3d, and empty large downloads you no longer need.sudo reboot and try logging in normally. If the disk was full, the loop is usually gone.If any graphical program was ever run with sudo, files in your home can end up owned by root. The session then cannot read its own authority files and quits. ⭐
ls -la ~ | head -30 and check the owner column - files should be owned by your username, not root.sudo chown $USER:$USER ~/.Xauthority ~/.ICEauthority - if a file does not exist, that error is harmless.sudo chown -R $USER:$USER $HOMEdf -i - a full inode table causes the same loop.If the home folder permissions were changed, the session cannot create its runtime files.
ls -ld $HOME - the line should start with drwxr-x--- or drwxr-xr-x and show your username as owner.chmod 750 $HOMEtouch ~/test-write && rm ~/test-write && echo OK - if this fails, the filesystem may be read-only; note it and continue to Fix 5.This one test tells you whether your account is corrupted or the whole desktop is broken.
sudo adduser testuser and set a simple password when asked.mv ~/.config ~/.config-backup and mv ~/.cache ~/.cache-backup, then try your own login again.Use this only when a new user also loops, or the loop started right after a driver install or upgrade.
sudo apt update && sudo apt install --reinstall gdm3 then sudo dpkg-reconfigure gdm3sudo ubuntu-drivers autoinstall after checking ubuntu-drivers devices, or remove the broken driver package you installed.cat ~/.xsession-errors - the last lines usually name the program that crashed the session.sudo -H sparingly or a terminal editor instead), because that is what creates root-owned files in your home. And do not delete your whole home folder or .config without a backup copy - rename first, delete only after login works.Every week: Windows problems, hidden tools and full setup guides, explained step by step.
Subscribe on YouTubeThe password is accepted but the desktop session crashes as it starts. The most common causes are a 100 percent full disk, root-owned .Xauthority or home files after running graphical apps with sudo, a broken graphics driver, or a corrupted session config. Open a TTY with Ctrl Alt F3, run df -h, and fix ownership with sudo chown on .Xauthority and .ICEauthority.
On the login screen press Ctrl Alt F3 to switch to a TTY text console. Log in with your normal username and password - the password does not echo as you type. Run the commands there, then press Ctrl Alt F1 or F2 to return to the graphical login, or reboot with sudo reboot.
.Xauthority in your home folder holds the access token the graphical session needs to talk to the display server. If it becomes owned by root, usually after running a graphical program with sudo, your session cannot read it and exits instantly. Fix it with sudo chown $USER:$USER ~/.Xauthority ~/.ICEauthority and reboot.
No. Checking disk space, fixing ownership, and testing with a new user do not delete personal files. Freeing space with sudo apt clean only removes downloaded package cache files. Only reinstalling Ubuntu or deleting folders would put files at risk, which is why this guide renames config folders to a backup instead of deleting them.
It means the system and graphics driver are fine and the damage is inside your own account - usually a broken file in .config or .cache. Rename those folders from a TTY with mv ~/.config ~/.config-backup, reboot, and log in. Ubuntu rebuilds fresh defaults, and you can copy back settings selectively from the backup.