Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 06 Mar 2001 18:10:18 +1100
From:      Tony Landells <ahl@austclear.com.au>
To:        "Ted Mittelstaedt" <tedm@toybox.placo.com>
Cc:        "T. William Wells" <bill@twwells.com>, freebsd-questions@FreeBSD.ORG
Subject:   Re: SUN TO BSD 
Message-ID:  <200103060710.SAA11316@tungsten.austclear.com.au>
In-Reply-To: Message from "Ted Mittelstaedt" <tedm@toybox.placo.com>  of "Mon, 05 Mar 2001 22:39:44 -0800." <001501c0a608$3ae7e8c0$1401a8c0@tedm.placo.com> 

next in thread | previous in thread | raw e-mail | index | archive | help
[ Ted's comments about the very real problems with Solaris passwd/shadow
file integrity omitted. ]

I've come across this as well.  We also ran into problems where people
were in too many groups, and the group entries were too long (I haven't
checked these on FreeBSD, but Solaris limits you to 16 groups with entries
in /etc/group being limited to 512 bytes).

In response, I wrote a PERL script which goes through all three files
and does sensible things:

	1. Deleting users from their primary group list in /etc/group
	(since they're in it automatically from the /etc/passwd entry).

	2. Deleting users from /etc/passwd that don't have entries in
	/etc/shadow (and vice versa).

	3. Deleting users from /etc/group that don't exist (possibly as
	a result of 2).

	4. Reorders /etc/shadow to match /etc/passwd.

	5. Reorders /etc/group so the groups are in numerically increasing
	order, and the users in each group list are in alphabetical order.

The loop in the middle is "extensible" by someone comfortable with PERL
so you could, for example, also delete everyone with a shell of /bin/false.

I can't actually post it without permission though, because obviously
it belongs to my employer.

Cheers,
Tony
-- 
Tony Landells					<ahl@austclear.com.au>
Senior Network Engineer				Ph:  +61 3 9677 9319
Australian Clearing Services Pty Ltd		Fax: +61 3 9677 9355
Level 4, Rialto North Tower
525 Collins Street
Melbourne VIC 3000
Australia



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




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