This post helps you in resetting your Linux root password, if you forgot it. Before we get started we want to make sure that we either have a console or direct access to the machine to accomplish this task.
1. Reboot your machine and wait for the below prompt.
2. Press any key and then you will be taken to the below menu.
3. Press key ‘e’ to edit the line as described in the lines of the above screenshot.
4. choose the desired kernel and press ‘e’ again to edit the line and type single at the end of the line as shown below and press enter.
5. Now, you will see the below prompt then press ‘b’ key to boot the machine.
6. The machine will boot and enter into the single user mode as given in the screenshot below. Now, you can reset the password as mentioned in the below two screenshots.
Finally, you are done. Reboot the machine and take the control over. 🙂