From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <96079341819617.tru64-unix-managers.marc@archive.invalid> From: Denis Cross Date: Sun, 19 Mar 2000 15:05:03 +0000 To: tru64-unix-managers Subject: Tools to manage the group file V Advise on writing own tools X-MARC-Message: https://marc.info/?l=tru64-unix-managers&m=96079341819617 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