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
Received on Sun Mar 19 2000 - 15:03:36 NZST