If the server is on and loaded, restart it using Send Ctrl+Alt+Del
At the moment when the screen with the bootback report to boot appears, press any key to get to the GRUB bootloader menu.
The very first item is the main boot kernel, select it and press e to start editing boot parameters.
Next, we select the item:
kernel /boot/vmlinuz-.
And also press e to edit
In the window that opens, add the word single to this line, separated by a space
Press Enter
This will bring us back to the GRUB menu, select kernel /boot/vmlinuz and press b to boot the operating system in single-user mode.
To set a new root password, type the command:
passwd
Enter the new root password twice:
Save the changes with commands:
exit
reboot