Creating a Group with default options :
- To create a group the syntax is
- #groupadd <name for the group>
- #groupadd admingrp
Creating a group with user specified group id (GID)
- #groupadd <option> <name for the group>
- #groupadd -g 615 admin
- Verify it in /etc/group
Modifying the properties of the group :
- To modify the group properties the syntax is
- #groupmod <option> <arguments> <group name>
- -g to change the group id
- -o to override the previous assigned id, if it matches with the new one.
- -n to change the group name
- Changing the GID of the group
- #groupmod –g 700 admin
- Verify it in /etc/group
Let see the groupid is changed.
Changing the name of the group:
Adding and Removing Members to a Group :
Adding multiple single or multiple users to the group with various attributes
- #gpasswd < option> <arguments> <group name>
Options:
- -M For Adding Multiple users to a group
- -A for Adding a group Administrator
- -a for Adding a single user to a group
- -d removing a user from a group
- #gpasswd –M <user>,<user>,<user> <group>
- #gpasswd –M admin2,admin3,admin4 newadmin
Adding a single user using gpasswd :
- #gpasswd –a admintl newadmin
Making a user as a administrator:
- #gpasswd –A admintl newadmin