SUMMARY Suggestions for removing /etc/passwd entries

From: Paul N. Youngblood <youngbp_at_uahis1.uah.edu>
Date: Thu, 10 Aug 2000 21:17:03 -0500 (CDT)

Hello System Admins,

Please see my original post at the end of this message.
I've received a great deal of very useful information on
this question. Many thanks to all of you who took the
time to help me out! I've listed you further on in this
summary. I know this summary is late and I apologize.
This is SUMMARY #1 and will be very brief. In about
two weeks when things are more settled, I'll submit a
more in-depth SUMMARY #2.

I completely forgot about the need to run mkpasswd
AFTER one operates on the /etc/passwd file without using
vipw. The mkpasswd is necessary to rebuild the hashed
database comprised of /etc/passwd.pag and /etc/passwd.dir.

First, of course, I need to backup the system. I understand
that it is possible to do the rest of this in multi-user mode
with a few precautions. However, judging from your responses,
I believe it will be easier in my particular situation to run
the rest in single-user mode. Run a script which uses sed or
awk on /etc/passwd to remove all unwanted users. Then run the
mkpasswd command. And then, while still in single-user mode,
I can do either one of the following:
(1) Run another script which uses "edauth -r" to remove the
    same users from the edauth database.
(2) Use the "convuser -d" command which automatically removes
    all users from the edauth database that do not appear
    in the /etc/passwd file.

More details later in SUMMARY #2. What a great list! Thanks
to all these kind people:

      Frank Wortner <frank_at_bondnet.com>
      John P Speno <speno_at_isc.upenn.edu>
      Alex Nord <Alex_Nord_at_Jabil.com>
      Robert Carsey <rcarsey_at_monmouth.edu>
      Jan Bacher <jb_at_jbacher.com>
      Dennis Breeden <D.Breeden_at_wcom.com>
      Richard Jackson <rjackson_at_portal.gmu.edu>
      Matt Moore <moorem_at_storm.bucks.edu>
      "Degerness, Mandell ISTA:EX" <Mandell.Degerness_at_gems2.gov.bc.ca>
      Amy <amy_at_aloha.nascom.nasa.gov>
      Bobby <bobby_at_du.edu>
      Thomas M. Payerle <payerle_at_physics.umd.edu>
      Nikola Milutinovic <Nikola.Milutinovic_at_ev.co.yu>
      Richard Rogers <R.M.Rogers_at_staffs.ac.uk>
      Robert Mulley <Robert.Mulley_at_Hawke.co.uk>
      Ann Majeske USG <ann.majeske_at_compaq.com>
      Tim Mooney <mooney_at_dogbert.cc.ndsu.nodak.edu>

----------original posting-----------------------------

Date: Thu, 27 Jul 2000 15:00:07 -0500 (CDT)
From: Paul N. Youngblood <youngbp_at_uahis1.uah.edu>
To: tru64-unix-managers <tru64-unix-managers_at_ornl.gov>

Subject: Suggestions for removing /etc/passwd entries

Hello System Admins,

I'm running Tru64 v4.0d and Enhanced (C2) Security.
It's time to clean up my user base (remove old, inactive
accounts). My /etc/passwd file has over 9000 entries.
I want to delete over 5000 specific users from that file
using some sort of automation. I don't want to RETIRE the
users, I actually want to remove them from /etc/passwd.
I know how to do the appropriate "edauth -r USERNAME" stuff,
etc, but I could really use some suggestions on a "safe" way
to operate on this password file.

What do you think about doing the following (Would this
work and be reasonably safe)? ...
Boot to single-user mode, and run a script which makes use
of something like sed to strip out the "bad" guys from
/etc/passwd. Will doing this without vipw cause problems?

I'm looking for a way other than using vipw and deleting
all 5000+ accounts manually. I'll certainly SUMMARIZE.
Thanks for you attention.

Paul Youngblood
Received on Fri Aug 11 2000 - 02:07:37 NZST

This archive was generated by hypermail 2.4.0 : Wed Nov 08 2023 - 11:53:41 NZDT