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

Re: Passwords



On Tue, Jan 17, 2023 at 01:53:33PM +0100, steve wrote:
> Le 17-01-2023, à 07:19:04 -0500, Greg Wooledge a écrit :
> 
> > On Tue, Jan 17, 2023 at 09:36:03AM +0100, steve wrote:
> > > Easier would be to delete the second field in /etc/shadow for root, so there
> > > won't be anymore root password (it's empty). You can then create one with the
> > > 'passwd' command.
> > 
> > If you can edit the /etc/shadow file, you're already root, which means
> > you can simply run "passwd root" to set a new password.  You will not
> > be prompted for the old password, so there's no need to clear the old
> > password hash preemptively.
> 
> You're right if you're editing the file in the OS, but not if you have
> accessed data from a live-cd, which was what I was thinking. Sorry.

If you went in via a Live CD, and mounted the Debian root partition,
the next step is to chroot into the Debian root partition.  Then you
can run "passwd root" in the chroot shell.  Then exit from the shell,
and unmount the Debian partition.

Of course, your way (which I'm assuming is "mount the Debian root
partition, edit the /debian/etc/shadow file to clear the hash, unmount
it, reboot into Debian, login as root with no password, and run "passwd")
also works, but it's a bit more effort.


Reply to: