August 2018
Intermediate to advanced
410 pages
9h 18m
English
A user is always a member of one group, the primary group, that is—as discussed in a previous paragraph—defined in the passwd database.
Besides being a member of a primary group, additional group memberships can be added. This can be necessary to get access to a group directory/share or to delegate privileges in the sudo configuration. You can add existing additional groups with the --groups parameter of the useradd command during the creation of a user or afterwards with usermod or groupmems.
Let's create a new user and a new group and verify the results:
sudo useradd studentsudo passwd studentsudo getent passwd studentsudo groupadd staffsudo getent group staff
Make the user student a member of the group staff:
sudo groupmems ...
Read now
Unlock full access