Can't login even with password Linux ubuntu [closed]

I can't log on, it lets me type my password in and almost logs in but then goes back to the login screen. Can't even login on the guest account. I tried Ctrl+Alt+F2 but it tells me my login is wrong even though I know it isn't.

Ubuntu 14.04.3


Solution 1:

You may need to change your password, or you may have the wrong username (does happen!).

First restart, then the moment the BIOS screen goes, press and hold Left Shift. This will open the GBUB menu.

From there, chose Advanced options for Ubuntu and then "Ubuntu with Linux 3.16.0-**-generic (recovery mode). If the numbers are different, don't worry. Just make sure it is recovery mode.

Then select "Drop to root shell prompt":

Next run the command ls /home. That will give you a list of usernames - check that yours is in that list (mine is tim).

If it is, then we will see if we can login from here. Type the following, followed by enter:

sudo login <username>

replace <username> with the username we just checked is correct. It will ask you for your username, like this:

If you get it correct, you should see a prompt that says "User@Computer-Name:~$". If the password is wrong, it will show "Login incorrect".

If your login is incorrect, we need to change it. That's pretty simple.

First, mount your file system:

mount -o remount,rw /

then just use this command:

sudo passwd <username>

and change username out for your username.

It will ask you for a password twice - make sure to enter the same one both times.