Ubuntu Login loop fix
This is frustrating.
Here is the simple method I followed to fix this issue.
This method also works for 22.04 and higher version
Tested also on Ubuntu 22.04 Focal Fossa recently and it worked.
Here are the Methods I followed along with the worked solution
You can try all these methods Because I'm not sure which one gonna work for you to fix the Ubuntu login loop. Please note that this method will also work for Linux mint login loop, Elementary login loop
Method 1: Fixing Permission of Xauthority
Open tty login with Ctrl+alt+F3 (I'm using tty3)
Enter your username and password, hit enter
and run this command ls -lA
find the line, It should be like this
-rw------- 1 USERNAME USERNAME 57 May 7 21:29 .Xauthority
if it is something different, run this command
chown username:username .Xauthority
Example: ninja is my username
chown ninja:ninja .Xauthority
You can press Alt+→
until you see the login screen.
This mostly fixes this issue, If not try another method below.
Method 2: Moving Xauthority
Press Ctrl+alt+F3 to open tty3 screen
Now type mv .Xauthority .Xauthority.bak
Press Alt+→
until you see the login screen
Try login again, If it's not working try another method below.
Method 3: (✅ Worked for me)
Press Ctrl+alt+F3 to open tty3 screen
Enter your username and password
Now, type startx
It'll open up the system desktop screen
Now, Open the terminal and enter the following command.
sudo dpkg-reconfigure gdm3
Now, Logout and press Alt+→
until you see the login screen.
This will surely work. If it's not working. Follow the below steps.
Method 4: Reinstalling gdm3
Press Ctrl+alt+F3 to open tty3 screen
Enter your username and password, hit enter
Run the below command
sudo apt purge gdm3
and press Enter then y
and enter
then
sudo apt install gdm3
sudo apt install ubuntu-desktop-minimal
Now,
startx
This will open up the home screen. (If the touchpad on your laptop is not working. Don't panic. Open Settings, under the mouse, enable Tap to Click)
Now open the terminal and type the following command
sudo dpkg-reconfigure gdm3
Now, logout and press Alt+→
until you see the login screen.
Mostly this will fix the issue. Otherwise, follow the below method.
Method 5: Fix temp directory permission
Run this command in tty
sudo chmod a+wt /tmp
That's it. One of these methods will surely fix this issue.
I hope is method helped you to fix Ubuntu Login Loop. If you still have issues. Feel free to write a comment.
Please note that this method also works for fixing the Ubuntu login loop in 20.04, the Ubuntu login loop in 21.04, and ubuntu login loop in 21.10
Related Articles