UB
Universal Blueβ€’2mo ago
GTG

reset password: bug in the manual?

Hello there! back from holidays, I tried to log in myt Bazzite box... and forgot my user password. Dig a bit in Bazzite's doc and found the proc: boot in bash, passwd... business a ususal. But it did not work! - I tried a first time, then reboot. Still can not connect. - Reboot, double check the doc, retry to reset, and check /etc/shadow before and after passwd command to check if password is really updated. - Ok, the hash is different, so password must be updated. - As an experimented guy, i take a photo of the hash... just in case... you know, it smell smoke at the moment 😁 - Reboot & login: password still wrong - Yes, smoke. - Reboot to /init/bash : The password is NOT the one i thought (As I said I took a picture previously). - Conclusion: I'm missing something or something is missing somewhere. The password is NOT updated with the official procedure. My thoughts : FS is read only and /etc/ files cannot be updated in init /bin/bash. A command or config is missing to be able to reset my password. Any clue or advise for me dear community? Thanks & have a nice day β˜€οΈπŸ•ŠοΈ
21 Replies
mrvictorywin (Ping on reply)
I used the password reset guide, it works. Use a simple password with only US English letters and/or numbers, there may be a keyboard layout issue.
Zed
Zedβ€’2mo ago
Did you follow all the instructions in the guide, including the selinux bits?
GTG
GTGOPβ€’2mo ago
Yes @mrvictorywin (Ping on reply) , very basic password. And, not a KB layout issue (I test to enter my password on command before using passwd line to check if 'a' is real a and not 'q' :p, nothing on this side) Yes @Zed , I strictely observe all steps. Enough time to memorized it πŸ˜‚
init=/bin/bash
mount -t selinuxfs selinuxfs /sys/fs/selinux/
/sbin/load_policy
passwd [USER]
sync
/sbin/shutdown -ff
init=/bin/bash
mount -t selinuxfs selinuxfs /sys/fs/selinux/
/sbin/load_policy
passwd [USER]
sync
/sbin/shutdown -ff
Zed
Zedβ€’2mo ago
Worth checking πŸ˜‰
GTG
GTGOPβ€’2mo ago
Sure! What is weird si the /etc/shadownot same between two reboot?
Zed
Zedβ€’2mo ago
That's why I was asking about selinux: if you don't do selinux steps, what will happen is your password in /etc/shadow will be updated, but selinux contexts will not be applied: so your password was changed, but the system doesn't have the policy to allow access to the file.
GTG
GTGOPβ€’2mo ago
hmmm But the file is changed on the 'init=/bin/bash' session I if reboot, this change is over...
Zed
Zedβ€’2mo ago
Oh, so: initial session: password hash is the original -> bin/bash session: hash gets updated -> reboot: hash is back to original?
GTG
GTGOPβ€’2mo ago
Yes
Zed
Zedβ€’2mo ago
I'd be curious what the output of ls -Z /etc/shadow is (before & after the passwd step)
GTG
GTGOPβ€’2mo ago
True, i will give output But not in front of my computer right now 😌 Hi there! Hi @Zed ! Little update on my issue!
GTG
GTGOPβ€’2mo ago
Here is the check requested:
No description
GTG
GTGOPβ€’2mo ago
But I was wrong on one point: the password is kept between reboot! This screenshot has been take just after reboot from previous password modification :
No description
GTG
GTGOPβ€’2mo ago
You can see that string for user greg is exactly same before and after reboot So /etc/shadow is updated I think But SDDM or TTY does not care... I'm sure it's not a keyboard issue (I used basic letters and try in clear on bash and sddm to be sure) So I dig on fedora universalblue side
GTG
GTGOPβ€’2mo ago
Fedora Docs
How to Reset the root Password
A root password may be set up while installing Fedora Linux, although it is now suggested to leave the root account locked and use sudo. This article describes how to…
No description
GTG
GTGOPβ€’2mo ago
Worth to try and... IT WORKED !! My password change have been take in account after this step! I've made a PR to update the doc Thanks for your help!
Zed
Zedβ€’2mo ago
Glad you got it working -- I might suggest a change to that PR, however, this:
No description
Zed
Zedβ€’2mo ago
Tells me that you almost certainly at some point tried to change the passwd in the rescue env without the selinux steps (only really takes once: perhaps you tried a different method initially?) The docs should work: the PR adds a step that should only be needed if things went wrong. It's probably good to include as info, as it's a really easy mistake to make, but shouldn't normally be needed, I'm pretty positive.
mrvictorywin (Ping on reply)
This could be the culprit, I did use the password reset guide and had no problems
Zed
Zedβ€’2mo ago
It's super easy to screw up, because simply trying to use a different guide that doesn't take it into account screws up the ability for the bazzite guide to work. So some sort of check of the env probably saves some sanity (saw this same thing happen on the Fedora discord 2 days ago, so I imagine it's not uncommon).
GTG
GTGOPβ€’5w ago
Hello there! You're absolutely right @Zed ! The very first time, I've made things on my own: init=/bin/bash, passwd, reboot... As I did thousand times before on various GNU/Linux box. Then it did not work, so I RTFM and noticed the selinux steps. Ok, piece of cake, let's do it. Then it did not work again. And now I understand this is because of my underskill around SELinux, not because of the doc! I should read one doc or two about SELinux ! Thx again men!! Yes @mrvictorywin (Ping on reply) , a guy on github suggest to modify my PR with a restorecon /etc/shadow instead for the noob like me!

Did you find this page helpful?