How Do I Add a User to Multiple Secondary Groups in Linux?
Contents to Add an Existing User to Multiple Secondary Groups, Use the Usermod Command with -G Option and the Name of the Groups with Comma. in This Example...
To add an existing user to multiple secondary groups, use the usermod command with -G option and the name of the groups with comma. In this example, we are going to add the user2 into mygroup and mygroup1 .
Can a user be in multiple groups Linux?
User accounts can be assigned to one or more groups on Linux. You can configure file permissions and other privileges by group.
How add multiple groups in Linux?
To create a new group type groupadd followed by the new group name. The command adds an entry for the new group to the /etc/group and /etc/gshadow files. Once the group is created, you can start adding users to the group .