Reboot the server and spam any key until you reach the grub menu.
At the grub menu press e, navigate to the kernel /vmlinuz option and press e again.
Then append "init=/bin/sh" to the end of the line containing linux16 (linuxefi if you're using a UEFI system).
Press F10 to boot and you should reach a prompt.
At this point the filesystem should only be read-only. Remount the filesystem so that it's writable.
mount -o remount rw /
Change the root password
passwd
Reboot the server and log in using your new password
- Updated