On Unix-like operating systems, the gpasswd command edits the passwords of groups.

Group passwords are stored in the files /etc/group and /etc/gshadow./etc/group contains group information, and /etc/gshadow contains encrypted versions of the group information.

Syntax

gpasswd [option] group

Options

(Except for the -A and -M options, the following options cannot be combined.)

  • Syntax
  • Configuration
  • Examples
  • Related commands
  • Linux commands help

Configuration

The following configuration variables in /etc/login.defs change the behavior of gpasswd:

Examples

gpasswd -a mozart musicians

Adds the user mozart to the group musicians.

gpasswd -A george mathematicians

Give user george administrative rights to the group mathematicians.

gpasswd -d hope yankees

Remove user hope from the group yankees.

newgrp — Log into a new group.groupadd — Add a group to the system.groupdel — Remove a group from the system.groupmod — Modify a group definition.