On Sun, Mar 02, 2003 at 01:31:28AM +0100, Matthias Buelow wrote:
> I wrote:
> 
> >after the latest crash of 5.0-p2/i386, my /etc/passwd and
> >/etc/master.passwd are trashed (I used chsh just before the crash).
> >My user line is missing in passwd, and the master.passwd file is
> >just binary garbage.  pwd.db and spwd.db however seem to be ok.
> >How can I recover the text files from the databases?
> >pwd_mkdb(8) talks about creating a v7 style passwd file via the
> >-p option but I don't know what to pass as file argument, if I
> >do pwd_mkdb -p /etc/pwd.db I get:
> 
> Following up my own mail, I found at least one solution in the
> meantime; there was a proper backup of master.passwd in /var/backups;
> and on that file pwd_mkdb worked.  The question remains, however,
> what to do in the case when only the databases are left and all
> textual files are trashed.  Surely there must be a way to create
> the text files from the db?
> 
> -- 
> Matthias Buelow
> 
> To Unsubscribe: send mail to [EMAIL PROTECTED]
> with "unsubscribe freebsd-questions" in the body of the message

Launch the utility `vipw` and then immediately close it without editing
anything.  It will recreate the file /etc/passwd from master.passwd if
it doesn't exist.

Nathan

-- 
GPG Public Key ID: 0x4250A04C
gpg --keyserver pgp.mit.edu --recv-keys 4250A04C
http://63.105.21.156/gpg_nkinkade_4250A04C.asc

Attachment: pgp00000.pgp
Description: PGP signature

Reply via email to