Reset Forgotten User Password¶
Important
This method is only if you forgot your current user password! Changing your current password should be done through the desktop environment.
Warning
Follow this guide at your own discretion because you can break your system attempting any of this.
- Reboot your device.
- Press Esc on the keyboard to reach the GRUB boot menu.
a. If you press Esc too many times, you may end up at agrub>prompt.
b. Return to the boot menu by typingexitand pressing Enter - Edit the last deployment by presssing E on your keyboard.
Edit the GRUB prompt and append init=/bin/bash to the line beginning with linux.
Continue boot process with Ctrl+X
Once you are in the GRUB command line:
-
Temporarily mount SELinux
mount -t selinuxfs selinuxfs /sys/fs/selinux -
Load SELinux policy
/sbin/load_policy -
Enter your new password (i.e.
passwd bazzite)passwd [INSERT USERNAME HERE] -
Sync
sync -
Reboot
/sbin/reboot -ff
Your user password should now be reset.
Thanks to Colin Walters for the solution.
Not Working?¶
Many users forget steps regarding SELinux because of old habits. If you've created everything but the SELinux steps above, then the file /etc/shadow will be unreadable or unreachable by any process.
The good way to check if /etc/shadow is in bad SELinux configuration is to execute following command:
ls -Z /etc/shadow
You should also notice unlabeled_t on your side.
You now have to fix the label on /etc/shadow with command below:
restorecon -v /etc/shadow
And then check result again with ls -Z /etc/shadow, which should lead to:
system_u:object_r:shadow_t:s0 /etc/shadow
Now the system is ready and you can reboot with /sbin/reboot -ff.




