Source: https://community.online.net/t/reset-root-password-via-console/1724/3
I solved this problem, found a hint here: https://github.com/scaleway/initrd/tree/master/Linux 184.
Here is what I did:
- Edit the “Tags” field in the server definition and add “INITRD_POST_SHELL=1” as one (or the only) tag.
- Reboot the server
- Wait until you get a shell
- Run:
chroot /newroot
- Change your password using passwd
passwd root
- CTRL-d to resume booting.
- Test your new password.
- Remove “INITRD_POST_SHELL=1” from your tags
I needed to also change the password for the mounted volume.
What worked for me was setting the tag, then reboot in rescue mode (under advanced settings) and change the password following the above steps.
Then proceed to the login screen by Ctrl-d, login as root, lsblk to see the available volumes, mount the volume (mkdir /mnt/volume && mount -o defaults /dev/vda1 /mnt/volume), chroot /mnt/volume, passwd there.