Symptoms & Diagnosis
The Kali Linux GNOME login loop is a frustrating cycle where entering your correct credentials results in a brief black screen before returning you immediately to the login prompt. This prevents access to the desktop environment despite the system being otherwise functional.
To diagnose the root cause, you must bypass the graphical interface. Press Ctrl + Alt + F3 to enter the TTY (Teletype) console. Log in with your username and password here to check if the shell is accessible.
Common triggers for this issue include a completely full hard drive, incorrect file permissions in the home directory, or corrupted GNOME configuration files. Check the .xsession-errors file in your home directory for specific error messages.

Troubleshooting Guide
1. Check for Disk Space Issues
A common culprit is a lack of disk space. If the system cannot write session files, GNOME will fail to load. Use the following command to check your disk usage:
df -h
If any partition (especially / or /home) is at 100%, delete large files or clear the package cache to free up space:
sudo apt clean
2. Repair .Xauthority Permissions
The .Xauthority file stores cookies used by xauth for authentication. If this file is owned by root instead of your user, the login will fail. Fix it with these commands:
sudo chown $USER:$USER ~/.Xauthority
ls -l ~/.Xauthority
3. Reinstall GDM3 and GNOME
If configuration files are broken, reinstalling the GNOME Display Manager (GDM3) often resets the environment to a working state.
sudo apt update
sudo apt install --reinstall gdm3 gnome-session gnome-shell
sudo systemctl restart gdm3
| Fix Type | Terminal Command | Target Issue |
|---|---|---|
| Permissions | sudo chown $USER:$USER /home/$USER | Home directory ownership |
| Clean Up | rm -rf ~/.cache/* | Corrupted session cache |
| Update | sudo apt full-upgrade | Broken package dependencies |
Prevention
To prevent future login loops, avoid running GUI applications with sudo. This often changes ownership of configuration files to the root user, locking you out later.
Regularly monitor your disk space. Kali Linux generates large log files and temporary data; use ncdu or df weekly to ensure you aren’t hitting the storage limit.
Always shut down the system properly through the menu rather than hard-powering off. Sudden power losses can corrupt the X11 or GNOME session files required for a successful boot.