Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

This question already has an answer here:

I am using ubantu 12.04 LTS. I have three users - one administrator and two standard users. I changed the password for administrator to 'None'. Later I used passwd command to set the password for the same user. But the password is not getting set.

share|improve this question
add comment

marked as duplicate by Eliah Kagan, Radu Rădeanu, karel, belacqua, BuZZ-dEE Jan 14 at 8:12

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

1 Answer

Boot from live CD.

Mount the / partition.

Chroot to the mounted partition

Assign a password to your account to activate it.

Details:

You’ll want to boot from your Ubuntu Live CD, choosing “Try Ubuntu without any change to your computer” from the boot menu.

Once the system boots, open up a new Terminal window from Applications \ Accessories and then type in the following command:

sudo fdisk -l

This command is used to tell what device name the hard drive is using, which in most cases should be /dev/sda1, but could be different on your system. enter image description here

Now you’ll need to create a directory to mount the hard drive on. Since we’re actually booting off the live cd, the directory doesn’t really get created anywhere.

sudo mkdir /media/sda1

The next command will mount the hard drive in the /media/sda1 folder.

sudo mount /dev/sda1 /media/sda1

Now it’s time for the command that actually does the magic: chroot.

sudo chroot /media/sda1

Now you should be able to use the passwd command to change your user account’s password, and it will be applied to the hard drive since we are using chroot.

passwd ADMINUSER

Note that you’ll have to type your username after the passwd command in order to change the right password.

Now you should be able to reboot your system and log yourself in with your new password.

share|improve this answer
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.