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. How reproducible: Always Steps to Reproduce: 1.usermod -G grp1 user 2.usermod -G grp2 user Additional info: 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 my team.
fixed in shadow-utils >= 4.0.12. $usermod -a -G grp1 user