LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   How to find out members of groups? (https://www.linuxquestions.org/questions/linux-general-1/how-to-find-out-members-of-groups-433088/)

essdeeay 04-08-2006 01:12 PM

How to find out members of groups?
 
How do I find out the members of a group?

I'm asking because the following shows user valiant$ to have a primary group called machines. But when I look in /etc/group, valiant$ isn't listed as a member of group machines.

Code:

[root@fedora ~]# id valiant$
uid=503(valiant$) gid=505(machines) groups=505(machines)

[root@fedora ~]# grep machines /etc/group
machines:x:505:

Thanks,
Steve :)

druuna 04-08-2006 01:53 PM

Hi,

machines is that users primary group (gid=505(machines)), only the 'extra' groups that is/are assosited with that user are shown in /etc/group.

id includes the primary group when it shows all the groups that user belongs to. In the above example, the user is only associated with one group (its primary group: machines).

/etc/passwd holds the users primary group (id, not the name) and /etc/group holds all the extra groups a user is assosiated with.

Hope this helps.

essdeeay 04-08-2006 01:56 PM

Thank you very much :)


All times are GMT -5. The time now is 11:58 PM.