gpasswd command

The gpasswd command is used to define the password for group and group user, the password is stored in the file /etc/group file and /etc/gshadow, the basic option for the gpasswd is as follows

gpasswd group
gpasswd -a user group
gpasswd -d user group
gpasswd -r group
gpasswd -R group
gpasswd [-A user,…] [-M user,…] group

-A option used for administrator
-M option used for members
-a option is used to add the user
-d option is used to delete the user
-r option is used to remove the password from the groups
-R option is use to restrict the access to the named group., Only group members with a password will be allowed to use newgrp to join the named group

About Anant 373 Articles
Senior technical writer