Ubuntu – Prevent new users from being added to a group with the same name as user name and instead add to generic group


I need to add several new users to a system. Each of these users should be a member of the same group – appdev – and should not be assigned to a group that is the same as their user name.

Can I do this automatically so that I don't need to use the -g or -G parameters when using adduser. Ideally, this would be something I could do once so that all new users in the future are also automatically added to this generic group and a group would not be created that has the same name as the new user(s).

Best Answer

In /etc/adduser.conf set USERGROUPS to no and USERS_GID to the GID of appdev.

Related Question