I lost administrative password.
I have tried – I know the regular method by which I go to GRUB menu and go to root (drop to root shell prompt) and set password there. It is well described – here. To be more specific I am aware about this method and have set the password many times when I have lost it before.
My problem – now my problem is that this method is not working. When I drop down to root shell it asks for root password again without which it does not progress. I do not have this password! What is the alternative then??
Best Answer
If you can access the root partition from another system, e.g. a live CD, you can as
root
from there edit/etc/shadow
; first you have tochmod u+w shadow
. Find the entry forroot
, it's probably the first one and looks something like this:Erase everything between the first two colons so you end up with:
Then
chmod u-w shadow
. You can now reboot the system androot
will have no password. You can just typeroot
at the login prompt and it won't ask for one. You can then usepasswd
to set one.Edit 1
Boot to the Live media. Open a terminal. Find out the device name for your primary disk.
sudo fdisk-l
will list all partitions.Like /dev/sda1 Mount this somewhere so we can use it:Then change directory
change privilage
edit file like I write
from
to
then
Reboot