Fixing 'Authentication Token Manipulation Error' in Ubuntu Linux
Cannot change user password in Linux because of Authentication Token Manipulation Error? Here are the possible reasons why it happens and how you can fix it.
Recently, I was changing password of a user in Linux when I encountered this ‘Authentication Token Manipulation Error’.
I used the usual passwd command to change the password and it threw me this error and password was not changed.
sudo passwd my_user_name
Changing password for user my_user_name
Changing password for my_user_name
(current) UNIX password:
passwd: Authentication token manipulation error
passwd: password unchanged
Fixing Authentication Token Manipulation Error in Ubuntu
The ‘Authentication Token Manipulation Error’ simply means that for some reasons, the password change wasn’t successful.
There could be a number of reasons for that. In simple cases, you’ll see the root cause of the issue in the output itself. For example, if you didn’t supply a password, you should see it in the error:
No password supplied
passwd: Authentication token manipulation error
passwd: password unchanged
Similarly, if the password retype mismatched, it will show that info as well:
Sorry, passwords do not match
passwd: Authentication token manipulation error
passwd: password unchanged
That’s easy because you know what caused the issue and you can take a corrective action based on that. But you might not always be that lucky because in some cases, you won’t see any useful information, just the error.
Let’s see some of these cases and fix this issue.
Method 1
If you know the Linux directory structure, you know that the /etc/shadow directory keeps the password in encrypted format along with a few other information about users and their password.
This is why you should make sure that you have the permission to read and write on this file. Since you’ll be changing the password as the superuser, this file should have read and write permission for the root.
ls -l /etc/shadow
-rw-r----- 1 root shadow 1488 Oct 14 18:07 /etc/shadow
If that’s not the case, then you should set the correct permission:
sudo chmod 640 /etc/shadow
Method 2
The method 1 will work in most cases. But in my case, I had to remount root partition with read and write permission. I was trying to reset my admin password in Ubuntu actually.
mount -rw -o remount /
In some rare cases, your disk might be so full that you cannot make any changes to the /etc/shadow file. But if that’s the case, then you’ll be facing a lot of other issues as well.
Did it work for you?
I shared what worked for me and I can only hope that it worked for you as well. Did it? Which method worked for you? Do mention it in the comments.
Creator of Linux Handbook and It's FOSS. An ardent Linux user & open source promoter. Huge fan of classic detective mysteries from Agatha Christie and Sherlock Holmes to Columbo & Ellery Queen.