5

The adduser command creates a new user, and also creates a new group and make this new group the primary group for the new user.

Based on my testing, the group created by adduser have the same name as he user created. But is this always the case, or are there some situations where the group will have a different name?

0
5

It depends on your systems configuration. By default, most systems I know will configure adduser or useradd to create a usergroup. See man 8 adduser:

ADDUSER(8)              System Manager's Manual             ADDUSER(8)

NAME
       adduser, addgroup - add a user or group to the system

...

DESCRIPTION
       ...

   Add a normal user
...
       By default, each user in Debian GNU/Linux  is  given  a  corre-
       sponding  group  with  the  same  name.  ...

Same holds for the low-level useradd:

USERADD(8)            System Management Commands            USERADD(8)

NAME
       useradd - create a new user or update default new user
       information
...

DESCRIPTION
       useradd is a low level utility for adding users. On Debian,
       administrators should usually use adduser(8) instead.

       ...

       By default, a group will also be created for the new user (see
       -g, -N, -U, and USERGROUPS_ENAB).

As long as you only use adduser and deluser, you shouldn't come into a situation where the group already exists.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.