1

Is there a possibility to define a default group for new Users? I mean I define the group testgroup as the default usergroup and when I add User1 and User2, both new Users would be in the group testgroup without defining this group on the useradd command as following?

# useradd -G testgroup User1

With

 # useradd -D

I get on the first line GROUP=100. But when I add a new User, the new user is added to a group called as the new user but not to the group with the id=100. For what is this definition?

1stthomas
  • 119
  • 1
  • 8

1 Answers1

3

You have to change the following line in /etc/login.defs to make the GROUP default in /etc/default/useradd active.

USERGROUPS_ENAB no

From man useradd

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

The why is probably because of security thoughts. But I am sure there are already some post somewhere out there discussing this. So open the search engine of your choice and...

Thomas
  • 4,155
  • 5
  • 21
  • 28