Is there a way to setup a password recovery system in case I lose it?

In another Linux distribution I used, at one point the password stopped working (don’t ask me why), I also think that I could maybe forget the password if I don’t use the PC often, is there a method to setup a password recovery system in case I have to change it or enter the system without using it?
Thank you in advance for any help!

If there’s a chance you’ll forget your own password, write it down. That may require you to (say) send it to yourself in an SMS or something, or maybe just sticking it on a post-it note that you keep somewhere where you won’t lose it.

If this is a desktop, or never leaves your property, you could always just not bother with a password. If it’s a laptop, you should have encryption turned on anyway.

The steps to restore the root password in Rescue Mode can be applied for other users as well (using the passwd <username>command instead).

The linked documentation is a bit outdated though, and there might be a need to temporarily set SELinux to permissive mode, as an additional step after step 8, by adding the kernel argument enforcing=0 to the boot entry (using the steps 1-4 from the document).

I have tested this on Fedora WS 41 and it works, but I suggest performing a test on a non-critical system first.

Note that this works for user passwords, but not for LUKS passphrases.

2 Likes

Sure, it’s a desktop, but I always want to be sure! Thanks for the reply.

Nice, I will check this out and save it.
Thank you.

1 Like