Setting /etc/shadow and removing the x in /etc/passwd removes the password entirely, so after that it should be possible to even boot normally (even without init=/bin/bash), log in without a password, and then you can just set another password.

This also works on encrypted systems, in the situation where you know how to decrypt the drive but you lost your password to your user account, and you have the ability to mount the root file system and edit those 2 files.

Reply via email to