Hi friends, here is a way to recover your Linux (all distributions) password when you accediently forget it...
To get around a lost Linux root password:
You must have access to the console for this to work. Follow these steps:
- Power off the system
- Power on the system, wait for the LILO/SILO/MILO prompt (platform dependent)
First :1: Second :2:)
Depending on how lucky you are, or rather how ancient your linuxdistribution is, you might be able to get away with the following:
- At the prompt, type <kernel> 1 (where <kernel> is the label you use to boot linux normally) and thus boot to single user mode.
- In single user mode, linux never used to prompt for the superuser password. If this is the case with your system, simply use mount -o remount -n / and then use the passwd command to change the superuser password.
- At the prompt, type in <kernel> init=/bin/sh (where <kernel> is thelabel you use to boot linux normally).
- Once the system dumps you at a "# " prompt, type: mount -o remount -n /
- echo root2:x:0:0:::: >> /etc/passwd
- echo root2:::::::: >> /etc/shadow
- sync
- Power cycle the system.
- Once the system has booted, log in as root2 (you shouldn't be prompted for a password) and use the command passwd root to change the root pasword,then userdel to remove the root2 user.
- Problem solved.
Thanks....
1 comments:
This tutorial don't work!
Post a Comment