Red Hat Bugzilla – Bug 56225
useradd ignores default group stored in /etc/default
Last modified: 2007-04-18 12:38:16 EDT
From Bugzilla Helper:
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows 98)
Description of problem:
Although useradd -D -g X will successfully set the default group (and
useradd -D displays it properly), useradd doesn't use the new default when
creating new users.
This looks to be a re-introduction of whatever was the problem in bug ID
26353 which affected RH 6.2.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1.Create a new group, by some means (ie creating a new user).
2./usr/sbin/useradd -D -g <name or gid of new group>
3./usr/sbin/useradd -D (to display the default settings)
4.Create a new user. id -a the new user - it'll show that the user was
not put into the new group - instead, a new group was created for the user.
This is contrary to the behavior of the command indicated within the
Actual Results: New user was created with wrong group.
Expected Results: New user should have been created with group set to the
new default group.
U need to use useradd -n.
-n option cause useradd not to create new group for user, but use default group.
see man useradd