Quickly control group membership, set group passwords and designate group administrators from the command line. 17.03.2026 | reading time: 2 min When multiple users must share access to files or services, group control matters; gpasswd puts that control in the shell and in a few commands that are easy to script. Live example ```bash # Create a group and add a user $ sudo groupadd developers $ sudo gpasswd -a alice developers Adding user alice to group developers # Set a group password interactively $ sudo gpasswd developers New password: Retype new password: # Remove the group password when it's no longer needed $ sudo gpasswd -r developers Removed password for group developers ``` Options worth knowing Use "-a" to add and "-d" to remove a user, "-A" to set group administrators and "-M" to set explicit members; "-r" removes the group password, and remember that group passwords and admin flags are stored in "/etc/gshadow" while membership is reflected in "/etc/group". When to reach for gpasswd Prefer gpasswd for quick fixes, scripted group changes or when you want a password-protected group for short-lived shared access; avoid relying on group passwords for long-term security and prefer proper ACLs, sudo rules or groups tied to centralized authentication where possible. Related commands to check Complement gpasswd with commands that create and inspect groups: use groupadd to create groups, usermod to adjust user primary and supplementary groups, and getent to query group entries from NSS or LDAP. Final note Mastering small tools like gpasswd sharpens system administration habits; continue exploring Linux system management and consider certifications such as CompTIA Linux+ or LPIC-1 with intensive exam preparation at bitsandbytes.academy. Join Bits & Bytes Academy First class LINUX exam preparation. security utilities setup