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

1 Answer 1

6

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.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.