Red Hat Bugzilla – Bug 49609
usermod/groupmod lack ability to add a user to a group w/o removing from other groups
Last modified: 2007-04-18 12:34:58 EDT
From Bugzilla Helper:
User-Agent: Mozilla/4.76 [en] (Win98; U)
Description of problem:
There seems no way to add a user "user" as a member of the group "grp", without removing user
from all other groups. by editing the /etc/group file directly the user can be added. But
"usermod -G grp user" will remove user from all other groups. There is no option for
groupmod command to add a user to a group, a logical place for such an option.
Steps to Reproduce:
1.usermod -G grp1 user
2.usermod -G grp2 user
It is important to be able to script user additions and changes such as group membership.
In migrating 2000+ users from OS/2 servers to Linux servers, I've run into this
same problem. It makes scripting mass user/group changes more complicated than
it should be in some situations. This feature addition would be well received by
fixed in shadow-utils >= 4.0.12.
$usermod -a -G grp1 user