I have lost the admin password. Tried the procedure in the detailed thread How do I reset a lost administrative password? but I keep having the same answer. After entering the new UNIX password and retyping it is saying "Authentication token manipulation error" and then "password unchanged" What should I do? thanks
I DO NOT TAKE CREDIT FOR THIS ANSWER
If Jorge's method didn't work for you, as it didn't for me, here is another method. I had to try something different because:
My USB keyboard did not work at the root prompt ⋯ probably hardware either keyboard or mainboard. To fix I used an old PS/2 keyboard (the little round plug) and use that.
When I used
passwd usernameto change my password, it failed because of a bad token or such. This called for drastic measures.
The Drastic Measures
This is a very dangerous thing to do! Jorge's method should be used; only do this in case that method doesn't work.
Do this at your own risk. It did work for me on my 11.10 system.
The idea is to set the user's password to blank (or null) - this allows you to just press Enter at the
Still at the root prompt from Jorge's method, first remount the root file system as read-write by using this command:
mount -o remount,rw /
- Now you are a super-user on this system. Tread lightly.
Then edit the password shadow file to remove the encrypted password for your username. Type in:
nano -B /etc/shadow
The nano editor will display the contents of the file. Each line will have the form
name:⋯:⋯:⋯… where ⋯ is a string or null (empty). One of the lines will start with your username. The first ⋯ after your username is your encrypted password. As an example:
$1$amFeNcjp$PprjCKEVk3UtzKwWfEMOY0 is the encrypted password.
Carefully delete the encrypted password leaving the all the ":"s, so it looks like this:
Then type Ctrl+O, press the Enter key to save, then Ctrl+X to close nano.
Reboot and you will have an empty (or null) password. Be sure to use
passwd username in a terminal to set or reset your user password.
Source for PS/2 workaround was here.
Note on nano ― the
-B option makes a backup of the original edited file, same name with a "~" appended.