Resetting password using "chroot" on encrypted (lvm) filesystem

Sometimes useful if you're locked out of a machine where you've forgotten your user or root password.

  • If you've forgotten your encryption password: .... find a dark corner and weep 'cause you probably wont get in without some black magic.

Boot up live session ... in console mode will do for our purposes, which is a lot faster.

Become root with "sudo su", elive will not prompt for a password and decrypt the filesystem (in my case /dev/sda3 as it's a uefi boot)

"cryptsetup luksOpen /dev/sda3 lost-machine"

and enter the decryption password when prompted.

Mount the unencrypted filesystem on "lost-macine" (you'll want the / filesystem where passwords are stored):

"mount /dev/mapper/elive_vg-root_lv /mnt"

  • TIP: make use of hitting Tab (autocomplete) after /dev/mapper to show the system names available.

Check if it is indeed the wanted root filesystem with "ls /mnt"

and "mount" to see if it is indeed mounted "rw" which is needed.

chroot into /mnt :

"chroot /mnt "

If you don't know the user name on the machine do:

"less /etc/group" where you'll probably be wanting the adm: user ... or to show other users do

"less /etc/group |grep 100"

  • To change the root password simply type "passwd" and enter a password for root and wait for the "successfully changed" message.

  • If you need to change a forgotten user password, like in my case for "triantares" you give the same command with the wanted username added: "passwd triantares" and after entering the new passwords, wait for the success message

And reboot the machine with Ctrl,Altand Del combo.
You'll find the passwords changed as wanted. :smiley14:

3 Likes

@triantares,
Thank you for your answer sometimes complicated ...but I'm always member or this forum! I sending for to have the new passwd for access here..It's OK because I'm here ! :grinning: can you do it like this , when I want my new passwd are OK give me the reason why this one are not in "clear" just with the 10 "points" the letter or number new one are not correct to be sure it's this I want to have ! It's impossible for verified my new passwd with the number & letter in clear ....
Here is the reason why I send my suggest for modified and accepted the new passwd :grin:
If I said that just for reinstall elive new one version , many thanks :grinning:

I'm not 100% sure what you're asking here but although it's out of scope of this Howto:

To view saved passwords in Firefox go to "menu", preferences,

and in "Privacy & Security", "Logins and Passwords"to "saved logins"

and at the bottom choose "show passwords" to show the passwords in plain text.

Alas I have no idea what the French entries blook like but this should show the way, I hope.For Chromium it is almost similar in menu, settings, logins ... albeit it has an icon to make the text visible:

Resetting those passwords is usually done by opting for "forgot password" on the login.

@triantares,
Ok that it's OK I have seen & recognize my password with success . When I reinstall Elive for the xièm times . I hope not trouble for connect to your forum...If I use firefox or chromium It's same thing .. many thanks for your help ,see you soon next times :sunglasses:

1 Like

well, technically im asking if E24 returns http instead of https , so E should always use httpS, if is the case, it should probably be reported

so the question was why the pasting of screenshots on the forum was not httpS by default :thinking:

Exactly that on my machine: it returns http.

I see the same behaviour.