Gentoo Archives: gentoo-user

From: Aljosha Papsch <papsch.al@××××××××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Resetting the root passwd
Date: Tue, 10 Jan 2012 20:46:15
Message-Id: 20120110204451.GB5847@creek
In Reply to: Re: [gentoo-user] Resetting the root passwd by Hinnerk van Bruinehsen
1 On Tue, Jan 10, 2012 at 08:12:53PM +0100, Hinnerk van Bruinehsen wrote:
2 > On 10.01.2012 19:46, Tanstaafl wrote:
3 > > Ok, I did something really dumb...
4 > >
5 > > I changed the root passwd for a system I manage last week, but
6 > > neglected to write it down, and now what I *thought* I had changed
7 > > it to isn't working... I know, I know, really *really* dumb, but
8 > > that's where I am...
9 > >
10 > > I know I can boot into Single User mode, remount the root
11 > > partition read/write, and edit /etc/shadow (removing the encrypted
12 > > passwd), then rest it using passwd, but...
13 > >
14 > > Some of the accounts in /etc/shadow have a '*' where the encrypted
15 > > passwd would be, and some have a '!'... (ie, one is sshd:!:... and
16 > > another is halt:*:...)
17 > >
18 > > Does it matter what I change it to? Should I use a *, !, or nothing
19 > > at all (so that there is *nothing* between the two :: that would
20 > > normally contain the encrypted passwd)?
21 > >
22 > > Thanks...
23 > >
24 >
25 > The simpelest solution should be to copy the password-hash of a user
26 > whose password is know to you.
27 > Afterwards you can log in an change the password again. And for the
28 > future: http://xkcd.com/936/ ;)
29
30 Or boot from a Live CD, chroot and set the password from there.