I am logging in to my Ubuntu Server using my username. Once I am logged in I am typing passwd
command. Entering a new password but a second after getting following error messages:
passwd: Authentication token manipulation error
passwd: password unchanged
What is wrong here? How can I change my password otherwise if I don't have access to that server physically, i.e. I am connecting remotely with ssh
using terminal.
Do these two things just to make sure:
This first part remounts the root partition as read/write since it was only in read mode. It actually dismounts the root partition and then mounts it again as read/write.
Then do this:
Then do the
sudo passwd USER
. It should work after that. This part gives the correct permissions to the shadow file.If you insert the wrong passwd
you get this error. If you are sure that you inserted the correct one, this error might also show up if you are using shadowed password files and the shadow doesn’t have an entry for this user (basically
/etc/passwd
has an entry for this user, but/etc/shadow
does not).In order to fix this, you can either add the entry manually (make a backup first!!!) or recreate the shadow file with
pwconv
(Manpage).fixed my messed
/etc/pam.d/common-password
I'm not sure how it happened. A sudo user created my account then deleted it then created it again.
Here is what I found
No change.
Showed no errors.
Showed no errors.
Looks normal.
Showed user and encrypted password.
Showed nothing. Not sure what that means but doesn't look right.
So the solution was to delete the password then reset new password.
Hope this helps.
Another problem might be that the disk is full. I got this error when resetting a password, and later checked my disks with
df
and found that no space is available on my disk. After freeing some I could reset the password without problems.This issue occurred due to the incorrect permissions set to
/usr/bin/passwd
.Please try to set the permission as 4511 by using the command:
This will resolve the issue.
If you are using SELinux, running this command fixed the issue for me.
Thanks to this conversation for the solution.
Check if you have messed up the common-password file in
/etc/pam.d/
. This will cause errors if your present password does not match the one thatcommon-password
wants. In my case this was the reason why I was getting that authentication token error.Also, ensure that your entry in /etc/passwd is not mal-formed. If you have the incorrect number of colons in the line for your user entry, the 'passwd' command cannot parse it and refuses to continue with the exact error message provided.
The error says that the PAM module (see:
man pam_chauthtok
) was unable to obtain the new authentication token. This may happen on Ubuntu when the user doesn't have default password set yet andpasswd
is still requesting it, so the workaround is to change the password usingroot
privileges, e.g.so you won't be asked for the current password and the error won't happen.
See also: Authentication token manipulation error