On Tue, Jan 10, 2012 at 08:12:53PM +0100, Hinnerk van Bruinehsen wrote: > On 10.01.2012 19:46, Tanstaafl wrote: > > Ok, I did something really dumb... > > > > I changed the root passwd for a system I manage last week, but > > neglected to write it down, and now what I *thought* I had changed > > it to isn't working... I know, I know, really *really* dumb, but > > that's where I am... > > > > I know I can boot into Single User mode, remount the root > > partition read/write, and edit /etc/shadow (removing the encrypted > > passwd), then rest it using passwd, but... > > > > Some of the accounts in /etc/shadow have a '*' where the encrypted > > passwd would be, and some have a '!'... (ie, one is sshd:!:... and > > another is halt:*:...) > > > > Does it matter what I change it to? Should I use a *, !, or nothing > > at all (so that there is *nothing* between the two :: that would > > normally contain the encrypted passwd)? > > > > Thanks... > > > > The simpelest solution should be to copy the password-hash of a user > whose password is know to you. > Afterwards you can log in an change the password again. And for the > future: http://xkcd.com/936/ ;)
Or boot from a Live CD, chroot and set the password from there.