On Sat, 7 May 2011, Stuart Henderson wrote:

> Yes this is expected behaviour. /etc/group lists secondary group
> memberships, /etc/passwd (and related files) list the primary groups.
> 
> Most of the tools you're using to investigate group membership
> (groupinfo, getent etc) only list secondary groups.
> 
> "id katia" is showing first the primary group (gid=31), and then a
> list of all groups this user has permissions for (either primary
> or secondary).

When you use useradd -g =uid, the primary group is created and the user 
put into it.

# groupadd kiki
# useradd kiki
# groupinfo kiki
name    kiki
passwd  *
gid     1001
members

versus

# useradd -g =uid kiki
# groupinfo kiki       
name    kiki
passwd  *
gid     1001
members kiki

-- 
Antoine

Reply via email to