tru64-unix-managers (formerly alpha-osf-managers) (1994-2012)
 help / color / mirror / Atom feed
From: Denis Cross <cathars () dial ! pipex ! com>
To: tru64-unix-managers
Subject: Tools to manage the group file V Advise on writing own tools
Date: Sun, 19 Mar 2000 15:05:03 +0000	[thread overview]
Message-ID: <96079341819617.tru64-unix-managers.marc@archive.invalid> (raw)

Hi

As the number of users increases, we are starting to use secondary
groups as a means of managing access to data. This is generally working
fine, however manually adding/removing user from secondary groups is
becoming a slow and error prone process.

I see two options to resolve this problem
1)	find some software which add/removes users from the group file - I've 
	searched the web and nothing has come up.

2)	Write my own code, which is OK, but I'd like some advise before I
start:

	I know that lines in the group file lines are limited in length, and to 
	get more users per group you have to create additional secondary 
	groups (different name, same ID), which appears to allow you to add 
	users to a group without limit.

	So I propose to use the format:
		Group1:*:45:			# defines the groups exists and gives real name
	Then for every user in the group
		Group1_user:*:45:user

	This makes adding a user a case of echo "Group_user:*:GID:user" >>
/etc/group
	Removing a user from a group, grep -v "Group_user" /etc/group >
/tmp/group
	Removing a user completely grep -v "_user:" /etc/group > /tmp/group

	All of which is very easy to script/test/prove. but are there any
reasons 
	NOT to format the file in this fashion?

Thanks in advance

Mike

                 reply	other threads:[~2000-03-19 15:05 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox