Re: Lost password need help!
eben@gmx.us wrote:
> On 11/22/24 11:56, The David wrote:
> > We have been using the debian 3.2.0-4-686-pae for our company. We are moving to another state and we forgot the password. Is there anyway to recover this without losing data? Thank you.
>
> Boot off rescue media, mount the victim's / partition somewhere, then edit
> <mount_point>/etc/shadow to change the second field (deliminated by colons)
> to the null string. An asterisk means "this user cannot log in", so not
> that. Then sync, unmount, and reboot. The first two steps may be implied
> in the third, but it won't hurt if they're done explicitly.
>
> So no, you can't recover it easily (the encryption is one way), but you can
> reset it.
If it isn't encrypted:
Boot. Pause the boot on the bootloader, and add to the kernel
command line:
init=/bin/bash
Let it continue booting.
When it gives you a shell, mount the root partition read/write:
mount -o remount,rw /
Change the root password:
passwd
sync
reboot
You now know the root password, and after logging in as root can
change any other user's password.
-dsr-
Reply to: