Many times people forget the root password of the Linux Servers. Please note that you must have the Grub Password before proceeding with the below steps.
Please follow the simple steps to recover root password of Linux server
- Reboot the system and press any button to enter into the Grub mode. Grub is a bootloader which enables you to choose between operating systems at startup. In the bottom, you would find many options. Press ‘p’ to enter Grub password.
2. After entering the correct password, you will find the below screen. Just select the OS, for which you want to recover root password and then press ‘e’ to do some editing before booting the server.
3. Select the entry where vmlinuz is mentioned Please press‘e’ again.
4. Here you will the command just write ‘1’ on the command after space to boot it to single user mode.
5. Once the system comes up, the shell prompt will appear. Here you can reset the password by using simple Linux command “passwd”.
6. Also if you want to disable Grub password, so that next time when entering Grub mode, it does not ask for the password.The same can be done by commenting the password entry in grub.conf file.
Now you are all set to recover root password from the Grub mode.