Password not working for sudo ("Authentication failure")

I had this problem when I was using a special keyboard layout (Bépo). The terminal was not recognizing the special characters. Maybe this is your problem too ?

How to change the keyboard-layout in the console, with special characters?


Run pkexec passwd $USER to change password. Then retry.

If it doesn't work, there are other troubleshooting things you can do (detailed in the question above).


I had this problem today. My password was the same but when I entered it for sudo it no longer worked. I am slightly concerned that I have been hacked, but that would be difficult because two firewalls would have to be compromised, and no one in the household would know how to change a passwd but me, so I am assuming that is not the issue, but I changed both user and root passwds as a precaution. Still not sure as to cause.

Method:

  1. alt-ctrl-f2 moves to a console. This does not work in a terminal or via su
  2. Login as root You need to have root's password, which is not the same as sudo.
  3. Execute command passwd USERNAME with your user name substituting for 'USERNAME'
  4. Enter a new password and confirm. Logout.
  5. alt-ctrl-f7 brings you back to your desktop.
  6. close all open terminals
  7. Open a new terminal and test with sudo ls.

This worked for me anyway. I was locked out of my account for 8 minutes because of fails, but I think this reset that timer. Anyway you might need to wait a few minutes or type 'man passwdand look up how to unlock the user from thealt-ctrl-f2` root account.

This will work even if you are at a desktop manager login screen, and you cannot login to your DM, as the alt-ctl-f2 console does not depend on the GUI at all.