From owner-freebsd-questions Mon Mar 5 23:10:24 2001 Delivered-To: freebsd-questions@freebsd.org Received: from nameserver.austclear.com.au (nameserver.austclear.com.au [192.83.119.132]) by hub.freebsd.org (Postfix) with ESMTP id 3C9DC37B719 for ; Mon, 5 Mar 2001 23:10:20 -0800 (PST) (envelope-from ahl@austclear.com.au) Received: from tungsten.austclear.com.au (tungsten.austclear.com.au [192.168.70.1]) by nameserver.austclear.com.au (8.9.3/8.9.3) with ESMTP id SAA59816; Tue, 6 Mar 2001 18:10:19 +1100 (EST) Received: from tungsten (tungsten [192.168.70.1]) by tungsten.austclear.com.au (8.9.3/8.9.3) with ESMTP id SAA11316; Tue, 6 Mar 2001 18:10:18 +1100 (EST) Message-Id: <200103060710.SAA11316@tungsten.austclear.com.au> X-Mailer: exmh version 2.1.1 10/15/1999 To: "Ted Mittelstaedt" Cc: "T. William Wells" , freebsd-questions@FreeBSD.ORG Subject: Re: SUN TO BSD In-Reply-To: Message from "Ted Mittelstaedt" of "Mon, 05 Mar 2001 22:39:44 -0800." <001501c0a608$3ae7e8c0$1401a8c0@tedm.placo.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Tue, 06 Mar 2001 18:10:18 +1100 From: Tony Landells Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG [ 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 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