[KLUG Members] Time to rebuild

Peter Buxton members@kalamazoolinux.org
Tue, 2 Sep 2003 12:56:50 -0400


On Mon, Sep 01, 2003 at 04:21:48PM -0400, Andrew Thompson was only escaped
   alone to tell thee:

> Anyway, it SOUNDS like all I'd need to do in the present situation is
> save those files and copy the one or two lines for the accounts in
> question back into the new /etc/passwd and /etc/shadow files after
> rebuilding the system? Let me know if I'm missing something, but
> thanks to both of you for the info and advice!

No one said this all in one post, but you need to update/check:

-rw-r--r--    1 root     root         1102 Jul 11 02:25 /etc/passwd
-rw-r-----    1 root     shadow        745 Jul 11 02:25 /etc/shadow
-rw-r--r--    1 root     root          657 Jul  6 23:29 /etc/group
-rw-------    1 root     root          526 May 18 20:36 /etc/gshadow

You only need the two shadow files if you have shadow passwords turned
on, but you almost certainly do. (Shadow passwords mean that the
passwords are removed from the publically readable passwd and group
files and segregated in their own private files.) Debian has a shadow
group but your distro may vary.

Make sure you don't alter the file attributes of the new files. diff(1),
sort(1) and uniq(1) may speed up the process considerably. Also, if you
have pwck(8) and grpck(8), you can check your alterations with them.
(pwck will complain if some system accounts have non-existant homedirs,
but that is probably intentional on the package maintainer's part.)

Also, as someone said, if you're reinstalling from RPM's, prefer the
package-created entries (i.e., the system accounts such as mail, uucp,
bind, sshd) to the old file entries. Remember that the account names
translate, but UID numbers (sshd is user 102, group 65534) don't and are
not the same for different installs.

For Debian, the divisions are:

         0 Always root.
      1-99 Static system accounts that are on every system,
           regardless of which packages are installed.
   100-999 Dynamic system accounts, installed as needed by packages.
1000-65533 Actual living, breathing users.

Your distro may vary.

-- 
-17
War is God's way of teaching Americans geography. -- Ambrose Bierce