Could not login in Ubuntu 20.04 LTS [closed]

I have just upgraded my operating system Ubuntu 18.04 LTS to Ubuntu 20.04 LTS. But after installing completely, during login I couldn't login even with right password.I checked it was indeed a right password by entering username and password after pressing Ctrl + Alt + F2, I even changed the password from advanced recovery mode but still new password also doesn't work. For the right password the screen goes black for like a second then again comes back in the same purple login screen but with wrong password it says -sorry, that didn't work. please try again. I am new to Linux and any help is appreciated.

2

2 Answers

It's caused by ticking 'enable automatic logging in' at installation. Open the terminal by pressing Ctrl+Alt+T. Login, then enter

sudo nano /etc/gdm3/custom.conf 

Change AutomaticLoginEnable from true to false, save the file, then reboot.

4

I think I have found the answer.It worked in my machine as this problem happened again.( But this works if you have more than one account with password known of superuser account and you want to login to another account with no superuser privileges where you could not login, else refer to @loginbugfixubuntu2004 's answer which could help.)

What I did was:

1.I pressed Ctrl + Alt + f3 ( you may do any f-keys from f2-f6 )

2.I login with a existing superuser account

3.You may make a home directory of "anotheruser" if no such home directory exists by:

$ sudo mkdir /home/anotheruser 

Then I copied the following files from superuser home directory to the home directory of that user where I could not login.

$ sudo cp .bashrc .profile .bash_logout /home/anotheruser 
 $ cd /home/anotheruser $ sudo chown anotheruser: . $ sudo chown anotheruser: .bashrc .profile .bash_logout 

5.then :

$ logout 

6.reboot then hope it will work now

7.If again it does not work then like I tried changing password it may for you too.

8.Again press Ctrl + Alt + f3 ( or other fkeys as said above)

9.login as superuser

10.Change the password of "anotheruser" by:$ sudo passwd anotheruser

11.$ logout

  1. Reboot and hope it will work now.

Note: This problem may also arise if you make user by $ sudo useradd newuser. Don't do this instead use the adduser command.

1

You Might Also Like