On this page you find all important commands for the CLI tool gpasswd. If the
command you are looking for is missing please ask our AI.
gpasswd
The gpasswd command line tool is used in Unix-like operating systems to manage group passwords. It allows system administrators to add or remove members from a group, change the group owner, and set or change the group password.
- The gpasswd command is typically used with superuser privileges or by users who have been granted permission to manage group passwords.
- It is a versatile tool that provides various options to modify group information.
- One of the primary functions of gpasswd is to add or remove users to a group using the -a (add) or -d (delete) options, respectively.
- Additionally, gpasswd can be used to administer group ownership with the -o (change group owner) option.
- The -M (set members) option allows administrators to specify a list of users to replace the group members with.
- It is also possible to set or change the group's password using the -r (set password) or -R (change password) options.
- The group password is stored in the /etc/group file but in an encrypted format.
- When setting a password, gpasswd generates a new random salt and prompts the user to enter the password, which is then encrypted and stored.
- The command can be further complemented by combining it with other tools such as grep, awk, or sed for advanced group management tasks.
- Overall, gpasswd simplifies the task of managing group passwords and provides a straightforward command line interface to handle group-related operations.
List of commands for gpasswd:
-
gpasswd:tldr:065e2 gpasswd: Remove a user from the named group.$ gpasswd -d ${user} ${group}try on your machineexplain this command
-
gpasswd:tldr:554c2 gpasswd: Set the list of group members.$ sudo gpasswd -M ${user1,user2} ${group}try on your machineexplain this command
-
gpasswd:tldr:8e488 gpasswd: Add a user to the named group.$ gpasswd -a ${user} ${group}try on your machineexplain this command
-
gpasswd:tldr:c7088 gpasswd: Define group administrators.$ sudo gpasswd -A ${user1,user2} ${group}try on your machineexplain this command
-
gpasswd:tldr:ed2ce gpasswd: Create a password for the named group.$ gpasswd ${group}try on your machineexplain this command