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.

A friend of mine has a old Ubuntu laptop that he wants to put back into use, but since it has been some time since he used it he has forgotten his password.

I've looked up how to change but none of them will work. I have also tried using the recovery mode, but using the root mode is locked also and requires a password. (We can not reformat the disk due to some pictures on it.)

Thank you in advance! :)

share|improve this question

marked as duplicate by Wilf, Aditya, Warren Hill, terdon, Eric Carvalho Mar 19 at 0:53

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.

    
Please read through this question. –  Wilf Mar 17 at 22:11
    
See this answer from Oli askubuntu.com/questions/24006/… –  Stormvirux Mar 18 at 1:16
add comment

1 Answer 1

You can boot the laptop with a live CD and chroot into the system and then change the password of any user. I have made this with the minimal installation CD from Gentoo.

  • Download this ISO image (or Ubuntu Live CD) and burn it or make boot-able USB with:

    http://distfiles.gentoo.org/releases/amd64/autobuilds/current-iso/install-amd64-minimal-20140313.iso

  • You need to find out the partitions on the old laptop. Assuming that you have an IDE hard drive with only root, boot and swap partitions you do this

    mount /dev/hda3 /mnt/gentoo/
    mount /dev/hda1 /mng/gentoo/boot
    swapon /dev/hda2
    
  • Then you need to mount proc,dev and sys

    mount -t proc proc /mnt/gentoo/proc
    mount --rbind /dev /mnt/gentoo/dev
    mount --rbind /sys /mnt/gentoo/sys
    
  • Then you chroot

    chroot /mnt/gentoo /bin/bash
    

After this you can change your password with passwd

I hope this help

share|improve this answer
add comment

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