[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: lost the root password



* Shukuko Yono said:
> I need to know whether there are any methods of finding the root password
There are none. The standard Unix passwords are encrypted using a one-way
encryption algorithm using so the only way to test for password correctness
is to encrypt the provided password and compare it to what's stored in
/etc/{shadow,passwd} or elsewhere (that's assuming you're not using any
password servers, one-time passwords etc.).

> for my machine.  I lost the root password, but I still have access to the
> machine as a different user.  
Do you have physical access to the machine? If so, just use your Debian
rescue disk, start it until you see the initial Select Monitor Type screen,
then switch to the 2nd console, press ENTER. Now, mount your usual root
partition as /mnt (or whatever :)) and edit /etc/shadow (or /etc/passwd if
you don't use shadow support) - remove the characters between the first and
second colons:

root:0irgffeYNn/ku:10787:0:99999:7:::
     ^^^^^^^^^^^^^ remove this
     (sample entry)
     
save file and reboot as you usually did. The root account has
no password now - log in, change your password and NEVER forget it again :))).
If you have no physical access to the machine, you're out of luck I'm
afraid...

good luck,

  marek
  

Attachment: pgpobPm5ZzoPR.pgp
Description: PGP signature


Reply to: