LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Group ID's and Files (https://www.linuxquestions.org/questions/linux-general-1/group-ids-and-files-54431/)

JBDM 04-10-2003 02:31 PM

Group ID's and Files
 
I am slightly confused with the use of Groups in Linux. The way I understand it, the group ID in the passwd field is used to assign an account to a particular group. The group file also has a member list. Can an account belong to more than one group?
For instance:
The account john has a group id of 25 in the passwd file
The group file has several groups
X::25:
Y::26:john
Z::27:

Does john belong to group 25 even though his name is not in the member list field?

Does john also belong to group 26, since his account is listed in the member list field?

Tinkster 04-10-2003 02:47 PM

The group field in /etc/passwd file is
the users default group, he doesn't need
to be listed in the group file for that one.

He does also (in addition to the group
he's assigned to in passwd) belong to
any group he's a member of in /etc/group.

Clear enough? :)

Cheers,
Tink

Mara 04-10-2003 02:50 PM

User john belongs to both groups. Group 25 is his main group, 26 is supplemantary. User can belong to many groups (there's a limit, but I don't remember the value).

BTW You can list all groups your user is in by using 'groups' command.


All times are GMT -5. The time now is 01:40 AM.