I was changing the password of my root account. After a minute, I decided to revert it back. Then I went away from the computer. When I returned, the lock screen wouldn’t accept the new, nor the old password. I’ve tried every iteration of the password but it still won’t accept it.
I specifically changed it back to not have this problem, and yet here we are.
Boot to rescue.target and use passwd to set the root password.
To get to rescue.target:
Interrupt the boot at the part where you can choose your kernel.
Select the kernel you want to use and press ‘e’ to edit the kernel parameters at the bottom.
Remove the string “console=ttyS0.115200n8” and add in it’s place “systemd.unit=rescue.target”.
Press ‘Enter’.
A few weeks ago I set up a Clear Linux based server and set it aside. Coming back to it I could for the life of me not remember what I’d set the root password as. In any event, multiple login attempts led to the root account being locked and inaccessible using the above means.
I resorted to booting the machine using systemrescuecd, mounting the partition on which Clear Linux is installed, and deleting /etc/password along with the shadow files. On reboot I was prompted to provide a root password and all was well, I had root access and was in control again.
A natural side effect is that the regular user account I’d created was also inaccessible - as I’d not done much with it I simply deleted the associated home directory and group and added a new user account. Hopefully this helps someone.
As I’d already exceeded the number of invalid login attempts to root account it was locked, so adter doiong what you suggested I got something along the lines of root account locked and couldn’t go further. If the root accoount hadn’t been locked your suggestion would’ve worked.