Cannot log in as root?

Recently I tried running a certain task that ran through sudo, but for some reason it kept saying my password is incorrect, I even had to write down my password where I can see it so that I can copy and paste it, still said password incorrect, then after I rebooted my password it worked just fine, I even wrote down the password in my text editor, copied and pasted it to my terminal, and the very same password that was denied at first was now accepted. Can I please get some help on this.

One possibility is that your account was locked out at the time. It only takes 3 password failures for that to happen so it is pretty common.

If it happens again run faillock to see if you are locked out.

3 Likes

How long does faillock usually last?

See here:

pam_faillock.so is enabled by default to lock out users for 10 minutes after 3 failed login attempts in a 15 minute period. The lockout only applies to password authentication (e.g. login and sudo)

4 Likes

I found out the hard way one time. I locked my laptop, so I could clean and wipe down my keyboard, so I pressed most of the keys in a short time. Once I finished cleaning I went to unlock my laptop only for Gnome to say not so fast! Now you have to wait 10 minutes for repeated failed attempts to login. Needless to say, I don’t clean my keyboard this way anymore :rofl:

1 Like

That with faillock is understandable, however I had the problem, which @Troykie describes, in former times already several times. And for sure it was not preceded by a wrong input. Start the computer, wait until everything is loaded, then open terminal and any command with sudo. Password fail and bang! Then the same password written in Kate document and copied to terminal, ok. However, not reproducible.

I’d say I had about the same experience before, and exactly as you explain it is exactly how it happened on my side, I even had to change my password thinking it was wrong

First, the topic title is at least wrong. You could say that your password seems to fail, or something similar. If sudo was buggy, it would be for every user, not only you, or your system, so we would have multiple same reports.

One other (than already suggested) possibility is keyboard hardware malfunction.
And another is a problem with keyboard layout configuration. Give more details on these, so we exclude easy problems.

1 Like

Not saying this is the problem, but is there a locale setting (and keyboard) that might apply here? (for example, en_CA vs en_US or en_UK can give some characters different ‘values’.

Worth eliminating, at any rate… :grin:

Also - what happens if a console is opened, and you try to log in as root?

1 Like

Definitely worth trying. Hit Alt + F2 for Gnome, KDE, etc, to see if you can log in.

Btw @Troykie welcome aboard the :enos: forum.

1 Like

You do understand that I typed the password in a text editor, where I could see every letter, and make sure its correct, then copied it and pasted it to my terminal, and it still denied my password, I think that rules out any keyboard malfunctions if there are any

Thank you for the warm welcome

1 Like

Yea, I think the locale setting got eliminated the time I typed the password down on the text editor because then I could see every value I got

Okay I’ll try that

1 Like
$ cd Downloads
$ su
Password: 
Downloads]# 

What is the output?

How will that be of help?

:sweat_smile:
If it works your root password works, if not something is very broken :melting_face:

1 Like

Oh no the password does work now, I’m asking for help so that the next time it happens I’ll know better

Please select the post that solved your problem. click the three … and check the box. If this is too complicated I will assist you. :hugs:

I will do so once I have it because as of now I think we’re all still trying to figure out what caused the login failure

You typed your password incorrectly three times…closing.

2 Likes