Only administrator account disabled.

Asked by Allen Holmburg on 2011-11-18

I set a 4 digit password using passwd.
Went to user accounts.
Typed this in terminal:
sudo su
passwd user -l

Now I have no idea how to re-enable my password or account
Currently I can log onto it because it is set to login automatically

I do not want to re-install, because I have done that 4 times in the past month (for various reasons) and I'm getting sick of it. For once I would like to fix it rather than trash it.

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu shadow Edit question
Assignee:
No assignee Edit question
Solved by:
Eliah Kagan
Solved:
2011-11-21
Last query:
2011-11-21
Last reply:
2011-11-21

Instead of:

sudo su

use:

sudo -i

None of these helped, sorry for not making this clear, but I know how to reset my password.
My guess of what happened, is that Ubuntu somehow glitched my password.
Every time it gives me the 'memory token authentication failed' 'password not set'.

You need to drop to root recovery to set it dude, Which release are you using?

please, do everything that i did before you try and help
getting to the shell script is not a problem, I just tried to change my password.

(this was root using the recovery mode method)
passwd user
asdf (it wasn't actually asdf, just another 4 character password)
asdf
authentication token manipulation error (or something like that)
password not set

and I'm using 11.10

First, try https://help.ubuntu.com/community/LostPassword#The_Other_Way. (If you find those directions confusing, then after it says "Your system will boot up to a passwordless root shell," you can start following the instructions at http://www.psychocats.net/ubuntu/resetpassword.)

If that doesn't work, then in your Ubuntu system, open a Terminal window (Applications > Accessories > Terminal) and enter this command exactly (you can copy and paste it)

mount | grep ' on / '

and press enter to run that command. You should see something like:

/dev/sda1 on / type ext4 (rw,errors=remount-ro,commit=0)

The part you're interested is the device name before "on" (in this example, it's /dev/sda1). Remember that, or write it down.

Now boot the computer from an Ubuntu Desktop Install CD (you can burn the .iso image to a CD or DVD, or write it to a USB flash drive and boot from that) and select Try Ubuntu. When the desktop comes up, run the Terminal and, in the Terminal window, run:

sudo mount /dev/sda1 /mnt

If the device name was different from /dev/sda1, put what you saw instead. Then run the commands:

sudo chroot /mnt
passwd USERNAME

Replace USERNAME with your actual username. This will enable you to type in a new password. Enter your new password twice, as it requests. It's OK that no placeholders characters (like *) appear while you're entering your password.

Then run these three commands:

exit
sudo umount /mnt
exit

The last of those commands quits the Terminal window. Reboot the system by clicking the power icon on the upper-right corner of the screen and clicking Restart. Make sure to remove the CD before the system boots up again, so that you can get into your Ubuntu system on the hard disk. Now that you've reset your password, you should be able to authenticate when necessary.

So the first method changing ro to rw and adding init*
but "kernel panic tried to kill init"
so I had to manual restart my computer, i'll try the others now

The method detailed above as an alternative to both http://www.psychocats.net/ubuntu/resetpassword and https://help.ubuntu.com/community/LostPassword#The_Other_Way should still work.

THANK YOU SO MUCH, YOU ARE A LIFE SAVER!!!!!!
If you can't tell, the method using the live cd worked. :D

Thanks Eliah Kagan, that solved my question.