The gpasswd command sets group passwords and manages members. This is a command related to account and group management. Only the superuser or group administrators can execute this command. The main purpose of gpasswd is to establish group passwords and add or remove users from groups. The default behavior (when no options are provided) is to set the group password. The "-a" option adds users to a group, "-A" assigns a group administrator, and "-d" removes users from a group.
Example: (Logged in as "root") # gpasswd -a adminusername groupname ←Add a user to the group # gpasswd -A adminusername groupname ← Assign a group administrator |