Forgot user login password of my librem 14 laptop

I forgot my user password of my librem 14 after changing it recently. I remember my disk-luks password. I can’t login into laptop. I searched solutions in the internet. The solutions are mostlt explained for ubuntu distro. They ask to enter root recovery mode in which passwd command is used. I tried the same in recovery shell. It says the command doesn’t exist. Please provide me a solution to login to my laptop without loosing my data.

I would search for solutions for Debian. That should work more likely than Ubuntu.

Yes i too searched that way. But the solution asks to enter GNU GRUB mode by pressing shift at the time of turning on laptop. This is not the case for librem laptop with pure os where we have an custom built options for booting.

I solved such passwd problem for my sister recently, she couldn’t recall her password but at this point of time I don’t recall how, didn’t even try, and to make my post more difficult here I don’t even possess Librem laptop. Therefore, what might be somehow better starting point of yours, would be to start to think about how to arrange things some other way around. Think about following advice from my side: in your shoes I’d take out your SSD drive, as you are the one that knows (excellent, this is your key advantage) encrypting password for it, install it somewhere else and mount it from there to another computer in order to save your data. Or just take out your current SSD drive out, as I already recommended, buy brand new solid-state drive, same or smaller size, put this new one in Librem 14, install PureOS again, put your current one (with your data) in some external hard drive housing an read it from there. Every other way around might endanger your data and you might loose everything, be aware of this fact please.

1 Like

I read this and at first I was very confused about why one would keep an SSD in their shoes.

2 Likes

Now, I’m questioning myself if I should edit or not to edit my post. No, I’ll leave it as is, even with my very coarse English writing style, I hope I’ve sold my recommendation anyway (hopefully serves the purpose). My every post actually needs some “real” polishing, especially grammatical ones, but might be that I’m just too old to jump to the next level of proper English writing. Sorry, this was my best shoot anyway, just not native English speaker, cannot change that fact (and don’t want to). And you know what, actually my favorite “pure” English writing style here, “modern” style (although unofficial type), very own and looks alike very intelligent one, comes from @hippi, just cannot help myself, even with the whole respect of mine toward proper and official American English language usage. Hope he/she is doing well! @Gavaudan thanks for your input, it was needed indeed (and made me laugh).

2 Likes

Here is something to try:

First, use another computer to create a bootable USB stick (a “Live USB” stick that lets you run GNU/Linux directly from the USB stick) with some GNU/Linux distro, it does not have to PureOS but could be Fedora or Ubuntu or whatever.

Then start GNU/Linux from the USB stick. Note that this should not require any password, you are just booting from the USB stick and not touching the regular disk.

Once running GNU/Linux from the USB stick, mount the regular disk. At this point you will need to provide your luks password. Then you should see the files there, look inside the home directory to check that all your stuff is there. Now you can copy files to at least rescue your data.

You can also use the chroot command to get a chroot environment where you can run commands with the regular disk as root, then you can run the passwd command inside the chroot environment to set a new password for your user. After that, remove the USB stick and reboot normally, then everything should be fine.

2 Likes

Don’t you change a thing, @Quarnero.

1 Like

I’ve just went through the following steps:

  • boot PureOS from usb stick.
  • fire up gnome disks (press the logo key, type disks, and it shows up)
  • in gnome disks, find, unlock and mount your root partition. The program will then tell you it is mounted somewhere under /media/*
  • fire up a terminal, get root by doing sudo su
  • execute chroot /media/...
  • then do the passwd command. (passwd yourusername)
  • memorize the new password :slight_smile:
  • exit terminal, in gnome disks unmount and lock the partition, reboot.
3 Likes

Great!

I guess that if you are anyway going to reboot, there is no need to explicitly unmount and lock the partition?

Also, did you verify that the new password really works after the reboot?

1 Like

I do not trust the reboot sequence to properly unmount and flush data to disks that were mounted by hand. If the data is not flushed, you are still getting your old password, which is lost. I may well be wrong here, but I’ve seen lots of such things in the past (I’m old).

Also, I’ve verified the new pasword and it indeed works after a reboot.

2 Likes

Is this the option and partition that you’re mentioning to mount the root partition?

1 Like

It is possible that the OP is not the first person in the world to have this problem :wink: because passwd even has the -R option to combine the chroot and the passwd in one. To be honest though, that is not something that I have tested.

You can also just use vi (or any other editor) to clear the password in /etc/shadow (i.e. make it a zero length string) and then reboot and then login without a password and then set your password normally. I believe that I have tested this option.

2 Likes

If you are using Passwords & Keys (seahorse) and are using the option to unlock a keyring automatically on login, I don’t know whether you will lose the stored passwords and keys in the relevant keyring if you reset the password in this way. Anyone know?

It is 499 GB LUKS one (Partition 2, with your data on it, under /home). You can also choose to use, perhaps works (not sure at the moment):
sudo mount /dev/nvme0n1p2 /mnt

After providing necessary password you’ll find your data with Nautilus under /media/... or /mnt.

Afterwards please use:

1 Like

But when i select the “499 GB LUKS” partition, i’m not getting the option of mounting it as i got it when selected “Filesystem Partition 1 1.2 GB Ext4” partition. Please refer the image. I’m getting the option “Unlock selected encryption partition” for “Partition 2 499 GB LUKS” but got the option “Mount selected partition” (refer my earlier reply post) for “Filesystem Partition 1 1.2 GB Ext4”

Try using that then, unlock it and see if you get the option to mount it after you have successfully unlocked it.

See what @Dwaff wrote earlier:

Perhaps “unlock and mount” there means two distinct steps: first unlock, then mount.

2 Likes

Yes, I did so and got the option. Thanks for the helpful response.

I finally implemented all the steps laid down by @Dwaff with the help of @Skalman . Thank you all for your help and participation on the thread🙂.

2 Likes

Glad you sorted it out. Sorry I wasn’t here to help further. I’ve had a very nice Sunday away from civilization.

3 Likes