How to recover password on linux : No CD Required.
NOTE: The following tutorial is for educational purposes only. We shall NOT be responsible, in any way, for misuse of the information provided.
If you forgot your old user password on Linux, you can recover it without any CD/DVD or pen drive. And it can be done within two minutes. ;)
Let us suppose that you want to peep into your friend's Linux computer, but he/she has a password that you don't know (NOTE: Though his is NOT recommended). Or, you changed your password and forgot it! In such a situation, the LINUX SHELL can prove to be a boon. If you do it correctly, no personal data would be lost and you can gain access within minutes.
We have tried it on Ubuntu and Linux Mint, both in Virtual Machine and in Dual Boot mode. And, it probably works for other Linux distros too.
=> Power on the machine. Press Esc key while booting to enter the GRUB Bootloader. A list of options will show up.

=> Select the OS and press 'e'. In the screen that shows up, go to the line that is similar to:
ro persistent quiet splash $vt_handoff

and replace the above text with:
rw init=/bin/bash

=>The above line introduces a shell at the time of booting. Press F10 key to boot.
=>After a few moments, the shell will begin. Congratulations! You are the root user. You can confirm it by typing whoami. It will show "root".

=>You have the root access to your system, but you still don't know the password! Now, you don't need the old password, but still you can change the password of ANY of the existing users.
=>To know the names of all the users, type the following commands:
cd home
ls

=>In our case, the username is niks. To change it's password, type:
passwd niks
And it simply asks you to type in the new password, no need of old password! Type the new password, press enter. Then retype it and press enter.

=>Voila! The password is now changed. Type the final two commands and your work is done!
sync
reboot -f
This will turn off the system. Now type in the new password, and access anything you want!

Note: To change the root password, instead of passwd niks, type passwd. It will change the root user's password.
No comments:
Post a Comment