Cannot login to any user on Ubuntu 16.04.1 other than guest

19,160

Solved

I didn't expect to find a solution before anyone posted an answer but this is what I did to get around this. I didn't fix it but I found a way to circumvent it.

By hitting Ctrl + Alt + f1 simultaneously, it will open up a terminal and ask you for your login and password. Your login name might be different that the one it actually displays when you login normally. You can list all accounts by using:

cut -d: -f1 /etc/passwd

Once I logged in, I tried creating another account with the name "test1" and password "test". For some reason it managed to work and I was able to log into the desktop (I still have no idea why! maybe it didn't like my user id).

sudo useradd test1
sudo passwd test1

I then gave the new test1 account admin privelages and then tested it to see if I could still login. It still worked so I figured I'd use the "test" account as my main account. You can give any account permissions with:

sudo adduser "USERID" sudo

I guess you can get the jist, delete the user that you can't log into. You can also change the name of your test account with:

sudo usermod -l "new name" "old-name"

to delete an account its

sudo userdel "USERID"

If you have files on your other user, I think you should be able to access it with the new sudo user that you created which means you can manually move/clone them.

If anyone can work out why it might have happened, I'd appreciate it, I don't think Ubuntu preffers one name over another, I tried with multiple different accounts and out of the usernames I tried including "the-mighty-d", "bl4ck-m4mba" or just "dan", "test1" was the only one that worked even though they were created in exactly the same way. (-_-")

Share:
19,160

Related videos on Youtube

Dan the Man
Author by

Dan the Man

Loading....

Updated on September 18, 2022

Comments

  • Dan the Man
    Dan the Man over 1 year

    I managed to finish installing Ubuntu today on to my spare laptop and I absolutely love the terminal. After exploring the UI for a couple hours, I updated it with:

    sudo apt-get upgrade 
    

    The upgrade was only about 128MB and took about 45 minutes with my really slow broadband. Once the upgrade was done, I restarted my computer.

    I have windows 10 also installed on the same laptop and whenever I boot up I have to chose between the two, so I selected Ubuntu and everything boots up as normal, no errors.

    When I entered the password for my main user, Ubuntu started loading my desktop but instead of being welcomed by it, I get a blackout for a few seconds then it goes back to the login screen after playing a noise.... at least my sound is working.

    The next logical thing for me to think of is to try the guest user which I'm glad I didn't remove. The guest user works fine and I get onto my desktop without an issue.

    I turn off my computer and restarted it a few times but still got same result. I then boot up Ubuntu in recovery mode and manage to get into the root shell which gives me access to root user commands.

    After doing that, I reset my password for my main user with:

    passwd "USER"
    

    I reboot my computer and I still cannot login. I go back to the root shell and I create another user with:

    useradd "NEWUSER"
    passwd "password"
    

    I restart my computer and it boots up with no problems, then I try to log into the new user that I had just created with the root shell and... the same thing happens.

    I then try something more crafty and I hit Ctrl + Alt + f1 when I'm asked to enter the password for my main user. It prompted a virtual console that I managed to log in to which means that this is not a problem of forgetting my password in any way.

    what dafuq is going on, can anyone think of a solution?

    • Mokubai
      Mokubai over 7 years
      In a day or so you should be able to accept your answer which will mark your question as resolved.