[KLUG Members] RE: Time to rebuild

Bob Kanaley members@kalamazoolinux.org
Tue, 2 Sep 2003 17:45:04 -0500


Andrew,

Since I have a relatively small number of users (under 50), when adding or
rebuilding servers I have often done a copy and paste of /etc/passwd and
/etc/group. Before you do the merge, be sure you have local copies of the
originals to refer back to. I just cat the files together in /root then run
sort -t: +2n /root/passwd and /root/group to help find duplicate UID's and
GID's. After you have the merged files cleaned up and moved to /etc be sure
to run pwck and grpck (part of shadow) just to be safe.

Bob

Robert V. Kanaley
Manager Information Systems
Agdia, Inc.
rvk@agdia.com
http://www.agdia.com


-----Original Message-----
> > Don't reformat /home and you should be fine on all above accounts.
>
> Okay, question on this: if everything EXCEPT /home is reformatted, are
> account names lost?

Yes.

> Is there a 'best' way to restore them if this is the case?

Save /etc/passwd & /etc/shadow somewhere (floppy, CDR, /home, other PC)

If you don't have a lot of accounts, you can copy/paste them back.
(the two files are just text files you can edit, but be careful! :)

Or you can edit out all the system accounts and append them to the new
/etc/passwd & /etc/shadow files.