Share your knowledge at the LQ Wiki.
Go Back > Forums > Linux Forums > Linux - General
User Name
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.


  Search this Thread
Old 04-10-2003, 03:31 PM   #1
LQ Newbie
Registered: Apr 2003
Location: Toledo, OH
Posts: 2

Rep: Reputation: 0
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

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?
Old 04-10-2003, 03:47 PM   #2
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,047
Blog Entries: 11

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908
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? :)

Old 04-10-2003, 03:50 PM   #3
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,551

Rep: Reputation: 161Reputation: 161
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.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to generate report with user id's in SARG jomy Linux - Networking 2 01-04-2011 04:05 AM
Get the sum of accounts id's that have the same group Smsem Linux - General 2 12-03-2004 03:54 AM
email-id's in an domain cyrilvictor Linux - General 1 11-03-2004 08:07 AM
group and password files in /etc Raphael M Slackware 2 08-14-2004 12:53 PM
Group Admin, Group Root, or God over Group crickett Linux - General 5 07-12-2004 05:01 PM

All times are GMT -5. The time now is 05:31 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration