If you have lost/forgot your linux machine root password, then you can reset it in simple methods.
1). Boot your desktop or server and wait for GRUB loader.
2). After getting the grub loader, just press "
e" to edit the entry.
3). Use arrow keys go to the kernel line and again press "
e" to edit the entry.
4). Go to the end of the line and give a single character space and type "
single" (without quotes) or
init 1 at the end of the line as shown in the screenshot. Then press "Enter" to accept the changes.
5). Press "
b" to boot this kernel.
6). Now you will get the root prompt. It's time to change the password.
Now type the following:-
[root@localhost /] passwd root
Enter new UNIX password: //type your new password here
Retype new UNIX password: //confirm again
7). Type
reboot to restart the system. Now login as root user with the new password.