1. Add a user group
To add a user group using the Groupadd command:
Groupadd group_name
This operation needs to be done by the system administrator.
2. Delete a user group
To delete a user group using the Groupdel command:
Groupdel group_name
This operation needs to be done by the system administrator.
3. Define Group Admins
Use the GPASSWD command to specify the group administrator:
Gpasswd-a User Group_name
This operation needs to be done by the system administrator.
4. Set the group password
To set the group password using the GPASSWD command:
GPASSWD group_name
This action is performed by the group administrator.
5. Remove the group password
To remove a group password using the GPASSWD command:
Gpasswd-r group_name
This action is performed by the group administrator.
Description: After you cancel the secret group code, only members can switch into the group through the NEWGRP command.
6. Add Group members
To add a member user to the specified group using the GPASSWD command:
Gpasswd-a User Group_name
This action is performed by the group administrator. (Usermod can also;)
7. Delete Group members
To remove a member user from a specified group by using the GPASSWD command:
gpasswd-d User Group_name
This action is performed by the group administrator.
Linux Add user groups and delete user groups