When you happen to lose the root password of your VPS and your VPS uses GRUB bootloader (almost all Linux distributions use this) you can follow the steps below to set a new root password:
- Go to the terminal in your control panel ('BladeVPS') and restart your VPS using the 'Reset' button.
- Keep the terminal open and right after the restart a message appears to press any key to open the GRUB bootloader menu. Please note! The prompt will be shown for a very short amount of time, so you will need to respond quickly
- Select the kernel at the top (this is the most recent kernel and the one which you probably use).
- Press a.
- Append a space behind the text followed by single and press ENTER.
- The OS now boots in single-user mode as the root user.
- Type passwd and press ENTER.
- Fill in your new root password and press ENTER twice.
- Reboot the OS and you should now be able to login as root user with your newly set password.
- Ubuntu users: For Ubuntu these steps differ a little; detailed steps for this procedure can be found on Howtogeek.
- It is unfortunately so that in case of Ubuntu that the boot cycle is so fast that the GRUB menu will not be displayed in time. You can increase the time this menu is displayed by increasing the value of GRUB_TIMEOUT=x in /etc/default/grub. Via sudo update-grub these changes can be activated.
- CentOS 7 users: In all derivatives of Red Hat Enterprise 7, which includes CentOS 7, the single-user / rescue-mode also requires the root-password before usable. Because of this the above steps will not work in these operating systems. There is another way of resetting the root-password, however this is a lot more complex than the procedure above. You can find the necessary steps to perform such a reset on tecmint.com.