Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 21 Nov 2009 20:27:26 -0800 (PST)
From:      George Sanders <gosand1982@yahoo.com>
To:        freebsd-questions@freebsd.org
Subject:   How can I rescue my passwd file after corrupting it (and why does it still work) ?
Message-ID:  <739790.37971.qm@web111611.mail.gq1.yahoo.com>

next in thread | raw e-mail | index | archive | help


I do some automated account creation on a FreeBSD 6.x system ... and unbeknownst to me, the '/' filesystem was completely full when I did my last account creation, resulting in:

/: write failed, filesystem is full
pwd_mkdb: /etc/pwd.db to /etc/pwd.db.tmp: No space left on device
pw: passwd file update: No space left on device
pwd_mkdb: corrupted entry
pwd_mkdb: at line #187
pwd_mkdb: /mnt/etc/master.passwd: Inappropriate file type or format

My situation is now as follows:

passwd and master.passwd have a lot of lines missing, and one or two mangled lines toward the end.  So a LOT of user accounts are gone.

BUT, all of those missing accounts still work.

So ... 

1) why do all of the accounts that are missing from both passwd and master.passwd continue to work properly (they can authenticate and log in over SSH and so on) ?

2) how can I get back to healthy ?

I suspect that somehow my (s)pwd.db files are still healthy ... is it possible to reconstruct complete passwd/master.passwd files using the existing (s)pwd.db files ?

Thank you.


      




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?739790.37971.qm>