Xref: utzoo comp.unix.questions:4761 comp.unix.wizards:5685
Path: utzoo!mnetor!uunet!husc6!rutgers!sunybcs!bingvaxu!leah!uwmcsd1!ig!jade!ucbvax!sdcsvax!hub!angst%csilvax@hub.ucsb.edu
From: angst%csilvax@hub.ucsb.edu (Dave Stein)
Newsgroups: comp.unix.questions,comp.unix.wizards
Subject: Re: Setting up groups (LONG)
Message-ID: <228@hub.ucsb.edu>
Date: 13 Dec 87 19:40:11 GMT
References: <4718@well.UUCP>
Sender: news@hub.ucsb.edu
Reply-To: angst%csilvax@hub.ucsb.edu (Dave Stein)
Organization: University of California, Santa Barbara
Lines: 36

In article <4718@well.UUCP>, samlb@well.UUCP (Samuel B. Bassett) writes...

>	How do you assign a user to more than one group?
>	[... stuff deleted ...]
>	I know how to create groups -- add an entry for the group name,
>password, group number, and a comma-delimited member list in /etc/group.

>	I know how to assign a given user to _one_ group -- put the group 
>number in the 4th column of his/her/its entry in /etc/passwd.

I don't believe this is sufficient to add a user to a group.  I think you
also have to add their login name to the group line in /etc/group.  I think
this field is superseded by the /etc/group file.

>	But if I want to have users be in _two_ or more groups (so they can
> read and write files in several different areas, I don't know how to do it.

I don't have root permission anymore, so I can't check out my answer, but
I'm pretty sure it's correct.  If not, please feel free to flame me (and,
of course, correct me).

To add a user to more than one group, you need only add the user name to 
each group line in /etc/group that you want the user to be in.  Where I
used to work, I was in the wheel group (group 0), in addition to about 5
other groups.  To accomplish this, I simply edited /etc/group.  Note that
you must log out and log back in after you edit /etc/group, because groups
are initialized during login.

Here at our site, root is in almost every group.  I'm sure it is similar
at your site.

Hope this helps!

Dave Stein						    "Life's a clambake."
ARPA: angst%csilvax@hub.ucsb.edu	      Disclaimer: college students don't
UUCP: ...ucbvax!hub!csilvax!angst			  need no disclaimers!