9

I'm very worried because I forgot my password to log into my Elementary System and now I can't log in, please help me as soon as possible. Thank you very much.

2 Answers 2

20

Using recovery mode:(using live usb/cd)

I assume you are the only user and the administrator of your system.

To change password, hold the shift key while booting live usb/cd. If that doesn't work, hold the shift key and hit esc key once after BIOS.

Note: Use arrow keys to navigate.

Select advanced options --> select recovery mode

Imgur

Imgur

Now using the arrow keys scroll down to root and then hit enter

Imgur

You should now see a prompt, something like this:

root@ravan:~#

It is read-only system, so you have to remount it with write permissions:

Run the command:

mount -rw -o remount /

then

passwd [user_name]

Enter new password.

Imgur

when you see passwd: password updated successfully then run exit and select resume option and hit Enter

6
  • well said!! cheers.
    – dhanushkac
    Commented Nov 7, 2015 at 1:30
  • you can upvote my answer @dhanush_c =)
    – Ravan
    Commented Nov 7, 2015 at 1:31
  • okay upvoted your answer.
    – dhanushkac
    Commented Nov 7, 2015 at 1:33
  • Windows 7 let's you also do something like this but Windows 8 / 10 doesn't. Elementary OS should secure recovery mode like 8 / 10
    – Suici Doga
    Commented Mar 14, 2016 at 7:47
  • I suspect this doesn't work if the assumptions that "you are the only user and the administrator of your system" don't hold true. I'm just getting started on elementary os, so they were true for me and it worked beautifully.
    – hlongmore
    Commented Nov 17, 2018 at 5:30
3

Using live USB/CD : (using recovery mode)

  1. Boot from live usb/cd and open terminal.

  2. Use gparted or fdisk -l to identify elementary OS partition from the list.

    The partition is just something like /dev/sda1

  3. Mount this somewhere (Be sure to select correct partition)

     sudo mount /dev/sda10 /mnt
    

Note :

  • . In my system elementary OS partiton is /dev/sda10, replace it with yours.

  • . If you have a lvm partiton, you need to mount it to /mnt/


  1. Now run the following command as it is:

     for d in dev sys run proc; do sudo mount --bind /$d /mnt/$d; done
    
  2. Now become root of system,

     sudo chroot /mnt
    
  3. Set the password for the account:

     passwd [user_name]
    
  4. Now reboot

    Imgur

source here

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