How to reset root password for Ubuntu server Print

  • ubuntu, vps, server, password
  • 1

To reset the password, you need to restart the server – press the key combination Ctrl+Alt+Del.

After loading the BIOS menu, but before the OS starts, you need to stop the boot timer and go to the GRUB menu – press any key except Enter.

You need to boot the OS in single-user mode and edit the bootstrap line. The arrows on the keyboard are used to move between the lines. You should highlight the line Ubuntu and go into edit mode – press the E key:

You should find the line that starts with linux /boot and replace the ro parameter with rw. You also need to add a new parameter init=/bin/bash.

Next, press the key combination Ctrl+X or F10. This action will boot the OS in single-user mode.

You need to enter the command in the console:

passwd root

And enter the new password twice:

Then you should save the changes:

sync

And reboot the system:

reboot –f

Was this answer helpful?

« Back