Linux Command - group commands
Commands to create, delete, and modify groups.
A group is a logical collection of users on a system.
/etc/group
execute cat /etc/group
to see all groups
sample output
1 | root:x:0:root |
/etc/group file format
- Group name
- group password here, usually x. The group password is encrypted and stored in file /etc/gshadow.
- GID(Group ID) number
- usernames of the group members
groupadd
option | description |
---|---|
-g, –gid GID | set GID |
add new group ‘dev’
1 | groupadd dev |
To add user jimmy to a group
1 | usermod -aG dev jimmy |
groupdel
Removing the group
1 | groupdel dev |
groupmod
chagne group’s GID to be 3333
1 | groupmod -g 3333 dev |
Reference