[arch-general] New users not automatically added to 'users' group if -g default group specified?

Leonid Isaev lisaev at umail.iu.edu
Wed Dec 4 13:57:23 EST 2013


On Wed, 04 Dec 2013 09:16:46 -0600
"David C. Rankin" <drankinatty at suddenlinkmail.com> wrote:

> All,
> 
>   In the past with arch installs, new users have always been added to the
> 'users' group. Now that is not being done. If I recall correctly, I have
> always specified that users are members of a group with the same name as the
> user by manually creating the group and using the useradd -g <group> option.
> This was done to keep UID and GID numbers the same across multiple boxes. On
> older installs all users were made part of the users group:
> 
> (July 2011 install)
> 
> [08:31 nirvana:/etc/httpd/conf] # grep users /etc/group
> users:x:100:david,anna,blah,blah,blah
> 
> (New install)
> 
> [08:45 phoinix:/etc] # grep users /etc/group
> users:x:100:
> 
>   Is this expected behavior, or has something gone wrong with the install? I
> ask because https://wiki.archlinux.org/index.php/Cron#Users_and_autostart
> suggest that all users should already be members of the 'users' group. I
> don't mind manually adding the users, but if this is a bug, I'll report it.
> 
> 

In short, this is OK; your user doesn't need to be mentioned in /etc/groups
after his primary group. If he is mentioned, then the primary group is also his
supplementary one (which is anyway automatic).

GID=100 (users) is a primary group, see /etc/defaults/useradd. The primary
group info is stored in /etc/passwd (userid:x:UID:primary_GID:...), so the
"users:x:100:"entry in /etc/group is dummy and AFAIU exists only to make
useradd happy. This is done to save space in /etc/group on systems with large
number of users.

My speculation would be that in 2011, you ran "useradd -m -g users -G
users,audio,... david". The correct call shouldn't contain "users" after -G.

Cheers,
-- 
Leonid Isaev
GnuPG key: 0x164B5A6D
Fingerprint: C0DF 20D0 C075 C3F1 E1BE  775A A7AE F6CB 164B 5A6D
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 490 bytes
Desc: not available
URL: <http://mailman.archlinux.org/pipermail/arch-general/attachments/20131204/bc83d0ae/attachment.asc>


More information about the arch-general mailing list