Arun K. Khan wrote:
On Fri, 2005-09-09 at 10:22 +0530, Rohit Baisakhiya wrote:
I forget the root password.How to recover the root password?
- Boot off of a rescue CD
- mount the / partition to /mnt
- edit /mnt/etc/shadow
- zap the password field (see man 5 shadow)
- Upon reboot: login and change the password
Instead boot in single user mode and change the password to what ever you want.
It is distro dependent -
SuSE 9.3 - need root password to boot into runlevel 1 FC 4 - !need root password to boot into runlevel 1 (I guess the same for derivatives of Fedora/Redhat)
Debian - ??
In debian you have option in Grub to boot debian in recovery mode, Boot the debian in recovery mode. 1> This will mount the root partition only in read mode. So You have to mount the root partition .....
#mount / -oremount,rw #passwd root
This will allow to change the root password.
If you don't have the Revovery mode then don't worry about it.
There is another good trcik......
When you enter in to grub select the any of your running kernel...(Because i have 5 Kernel). Pres 'e' button to edit the argument for that kernel. Select ...
kernel /boot/vmlinuz-2.6.13.1 root=/dev/hda1 ro
Press again 'e' for edit this argument...And simply put 'init=/bin/sh' Press enter then 'b' to boot that kernel that will boot Linux box in Recovery mode. Now again follow the <1>....
This trick can work in any Linux distro..... ;)
With Cheers, Hardik Dalwadi.