[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.

Or mounted the disk externally on another system.

Still there's the -R (chroot) option for passwd(1) as an alternative
for those cases. But editing is definitely a valid option (esp. if
you are dealing with an OS you suspect format compatibility problems
because of its age or some such).

There is more than... and so on :)

Cheers
-- 
t

Attachment: signature.asc
Description: PGP signature


Reply to: