Reset the Root Password in CentOS

If you have forgotten the root password, it is possible to set a new one by interrupting the boot process at the GRUB stage and forcing the system into run level 1 (single-user mode).3

Follow these steps

  1. Launch the KVM interface for your server to access it from the console.

  2. Interrupt GRUB by typing a character, such as a space

  3. Append to the kernel line by typing a backspace through rhgb quiet and appending 1 and pressing <enter>.

  4. This will give you a root shell and not a login prompt. From there, you can use the passwd command to set a new root password.

  5. Restart the Server and allow it to boot normally.