14

I installed 20.04 (upgraded from 18.04) and cannot log in at all. I’ve tried changing my password using recovery mode, installing lightdm, and using Ctrl-Alt-F3.

Strangely, when using Ctrl-Alt-F3, I can log in as root, but not into my personal account. Even after I change the password to my personal account using the command line in recovery mode, I can’t log in to my personal account. I can log in to root just fine.

I had a yubikey I would login with on 18.04, maybe that’s what’s wrong? I checked the pam.d files and they seem to have reverted back to their original state (I had to edit them to get the yubikey to work).

I am stuck and could use some help, thanks in advance!

9 Answers 9

2

Weird. Same problem, but Ctrl+Alt+F4 changed it to my logged-in desktop

0
1

Suggesting more potential solutions.

Try logging in via the text console (CTRL+ALT+F1) which tries to do fewer things than the graphical login. If you cannot login via the text console, then the problem might be an actual password typo or a keyboard layout issue. If you need to change your password, reboot into recovery mode in the grub menu, choose "drop to root shell", and run passwd myuser.

If your text console login works, but you can't login via the graphical interface:

  • Be mindful of the keyboard layout active when you enter your password. you can change the default layout of the linux console by following steps in https://superuser.com/a/404507/525084 .
  • If you've reused your /home directory from a previous installation, and you changed your password in the new install, you won't be able to mount any encrypted home filesystem and the graphical desktop will boot you out right away. If you use an encrypted /home, you'll have to re-wrap your ecryptfs configuration to recognize the new password (see how to change password of an enrypted ubuntu user account?).
1

Quite a few people have had this issue, also with previous versions.

None of this worked for me. My problem was a wrong user ID and the fix is simple.

To find out whether your login problem has the same cause

echo $USER $UID
     NEWUSER 1000

This showed the NEWUSER had ID 1000, but the files in the directory had a different ID.

  ls -n  roots.jpg           # in the new home directory on some files
    -rw-rw-r--  1 1001 1001 102869 Jan  6  2019  roots.jpg

This shows that the files were owned by OLDUSER with ID 1001.

This fixed it for me

  sudo chown -R NEWUSER:NEWUSER *
  sudo chown -R NEWUSER:NEWUSER .*   # to include hidden files and directories

Here is what had caused my problem: The user I made the fresh install for [let's say NEWUSER] was not the same user under which I had installed Ubuntu the last time [OLDUSER]. This happened because the last time I installed Ubuntu it was under OLDUSER, then I added somebody else afterwards, called NEWUSER. This time I installed for NEWUSER only. Ubuntu assigns the first user the ID 1000. As a result the user IDs were now different, and with it the permissions to log onto the desktop, which is why the graphical login failed. In my case OLDUSER was 1001, NEWUSER was 1000.

An emergency fix that allowed graphical login was

sudo mv .local .local_old

Note that this will not fix your application and file settings and should only be used for a quick GUI peak.

1
  • I believe that @Christians solution should be corrected, since > sudo chown -R NEWUSER:NEWUSER .* will also go to .., and corrupt other users permissions. I believe that this should rather be sudo chown -R NEWUSER:NEWUSER /home/NEWUSER
    – Maxim
    Aug 29, 2022 at 9:43
1

I once or twice had problems logging in with my account. Removing/renaming one of the (desktop?) configuration settings solved the problem. I can't remember exactly and I can't check right now, but I think it was the ~/.config/lxsession folder.

1
  • I ended up messing with my pam.d files, and I think that did the trick. I edited out some lines I added to configure the yubikey. Once I got back in, I had to reinstall ubuntu-gnome-deskto (which was a PITA, I had a bunch of broken packages), but I did finally get it working. Apr 27, 2020 at 17:51
1

I faced a very similar issue recently with a "login loop" and turns out after upgrade some files used by X sessions were missing, for example /etc/X11/xorg.conf and /home/<user>/.Xauthority.

The steps that worked for me were:

  • Open tty3 with Ctrl+Alt+F3 and login with your credentials
  • sudo apt dist-upgrade
  • sudo apt install --reinstall gdm3 ubuntu-desktop-minimal
  • sudo dpkg-reconfigure gdm3
  • X -configure
  • cp /home//xorg.conf.new /etc/X11/xorg.conf
  • startx

At this point I was able to see the X session starting ok (which before was impossible).

Finally reboot your system and login as usual.

Hope it helps!

0

Seems the problem is fixed. Try to update.

sudo apt update & sudo apt upgrade

I had the same problem, and was fixed after updating my machine.

1
  • How do you run these commands if you cannot login?
    – UweM.
    Jan 20, 2023 at 13:12
0

I was having the same issue with a fresh ubuntu installation. I logged in from the terminal pressing Ctrl+Alt+F4 Then I followed the instructions to create a new account Link with a new name [Solved

Things that did not work:

  • Reinstall ubuntu
  • apt install update upgrade etc
  • Install Nvidia toolkit and drivers

enter image description here

0

I had a similar login problem with Xubuntu 20.04.1 after an update. I figured out my disk is out of space. So I logged in via the text console (Ctrl+Alt+F3) and ran

sudo apt autoremove

after that, I was able to log in normally.

0

I believe that @Christians solution is the best, but should be corrected, since

sudo chown -R NEWUSER:NEWUSER .*

will also go to .., and corrupt other users permissions.

I believe that this should rather be

sudo chown -R NEWUSER:NEWUSER /home/NEWUSER

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .