1833323 Members
2911 Online
110051 Solutions
New Discussion

User Groups

 
BPatel_1
Advisor

User Groups

Hi All,

I want to know which file to refer in order to get the secondary group assignment information directly instead of going through the SAM and manullay checking the group information for details.

Is there a file which gives me this info. I have checked /etc/group file but this does not provide me the exhaustive details

Thanks in Advance
7 REPLIES 7
A. Clay Stephenson
Acclaimed Contributor

Re: User Groups

logins -g group
If it ain't broke, I can fix that.
Sundar_7
Honored Contributor

Re: User Groups

/etc/group is the only file. It lists the secondary group membership for the users. But remember, you will need to get the primary group information from /etc/passwd.

As mentioned above, logins -g group will display all the members of that particular group.
Learn What to do ,How to do and more importantly When to do ?
Patrick Wallek
Honored Contributor

Re: User Groups

What "exhaustive details" do you want?

The /etc/group file lists all groups that have been configured on your system and the will list all users that are setup with each group as an additional group.
James George_1
Trusted Contributor

Re: User Groups

Hi

what information are you looking for ?

# id login_id

will give u the roup membership info. As others have mentioned, you can also look at /etc/group file.

Rgds / james
forum is for techies .....heaven is for those who are born again !!
AA786
Frequent Advisor

Re: User Groups

Hi ...

/etc/group
details are there

# id loginname
can see the info related this ID

AA
Dennis Handly
Acclaimed Contributor

Re: User Groups

To get secondary group assignments without using newgrp(1), you need to symlink logingroup to group:
/etc/logingroup@ -> /etc/group

See group(4).

>I have checked /etc/group file but this does not provide me the exhaustive details

I'm not sure what you think is missing??
M. Bouherrou
New Member

Re: User Groups

Did you check or know if your system uses NIS or LDAP?
For NIS, use "ypcat group" to get the list of all groups, with GID and list of users UIDs (separated with ',' ).
The best options is still to use id or groups command. "id -Gn" to get the groups for the current user or "id -Gn uid" to get them for a user "uid"