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
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
Now using the arrow keys scroll down to root and then hit enter
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.
when you see passwd: password updated successfully
then run exit
and select resume option and hit Enter
-
-
-
-
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 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. Commented Nov 17, 2018 at 5:30
Using live USB/CD : (using recovery mode)
Boot from live usb/cd and open terminal.
Use
gparted
orfdisk -l
to identify elementary OS partition from the list.The partition is just something like
/dev/sda1
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/
Now run the following command as it is:
for d in dev sys run proc; do sudo mount --bind /$d /mnt/$d; done
Now become root of system,
sudo chroot /mnt
Set the password for the account:
passwd [user_name]
Now reboot
source here