Assign password to Linux Group

gpasswd is used to modify the group password and add/remove users to/from a group. The gpasswd command is used to administer /etc/group, and /etc/gshadow. Every group can have administrators, members and a password.

Syntax:

gpasswd [option] group

Example:

Add user k2admin2 to group Database_Groups

gpasswd -a k2admin2 Database_Groups

Assign password to Linux Group

Options:

Option Description
a add USER to GROUP
d remove USER from GROUP
r remove the GROUP’s password
R restrict access to GROUP to its members
M set the list of members of GROUP
use this encrypted password for the new group
A set the list of administrators for GROUP Except for the -A and -M options, the options cannot be combined
Powered by k2schools
Skip to toolbar