0% found this document useful (0 votes)
21 views4 pages

Ch-5-Lab: Group Administration: Objective: Pre-Requisite: Topology

1. This document provides instructions for performing various administrative tasks relating to user groups in Linux, such as creating a new group, modifying group properties, adding and removing users from groups, and deleting a group. 2. It includes commands for adding a new group, assigning a password to a group, changing the name of an existing group, adding single or multiple users to a group, adding a user as a secondary or primary group member, and removing a user from a group. 3. Verification steps are provided to check that each change was successfully made by grepping the /etc/group or /etc/gshadow files.

Uploaded by

sara Mohamed
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
21 views4 pages

Ch-5-Lab: Group Administration: Objective: Pre-Requisite: Topology

1. This document provides instructions for performing various administrative tasks relating to user groups in Linux, such as creating a new group, modifying group properties, adding and removing users from groups, and deleting a group. 2. It includes commands for adding a new group, assigning a password to a group, changing the name of an existing group, adding single or multiple users to a group, adding a user as a secondary or primary group member, and removing a user from a group. 3. Verification steps are provided to check that each change was successfully made by grepping the /etc/group or /etc/gshadow files.

Uploaded by

sara Mohamed
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

CH-5-LAB: GROUP ADMINISTRATION

OBJECTIVE:
To create a new group and modify an existing group's properties
PRE-REQUISITE:
Machine with Linux Installed
TOPOLOGY:

1. To add new group Syntax:


[root@localhost ~]# groupadd <groupname>
[root@localhost ~]# groupadd zoomtech

Verification:
[root@localhost ~]# grep zoomtech /etc/group
zoomtech:x:1000:

2. To assign password to a group

Syntax:
[root@ local host ~]# gpasswd <groupname>
[root@localhost ~]# gpasswd zoomtech
Changing the password for group zoomtech New Password:
Re-enter new password:

Verification:
[root@localhost ~]# grep zoomtech /etc/gshadow
zoomtech :
$6$KoqFT/.FII$TKrAHtcPHa7iEvOc/YG7AvBeELtngSRZWWzxxOODc/rOKlNyi5wfe
kM wqdl0HNz5.NDCAIty6wghkCC2ld6J70::
3. Changing the name of an existing group (from zoomtech to zoomgroup)

Syntax:
[root@ local host ~]# groupmod -n <new_name> <old_name>
[root@localhost ~]# groupmod -n zoomgroup zoomtech

Verification:
[root@localhost ~]# grep zoomgroup /etc/group
zoomgroup:x:1000:

7/. To add single user in a group


Note: Before you add user into group create a user [root@localhost ~]# useradd jack

Syntax:
[root@localhost ~]# gpasswd -a <username> <groupname>
[root@localhost ~]# gpasswd -a jack zoomgroup
Adding user Jack to group zoomgroup

Verification:
[root@localhost ~]# grep zoomgroup /etc/group
zoomgroup:x:1000:jack

5. To add multiple users in a group


Note: Before you add user into group create some users
[root@localhost ~]# useradd wiliam [root@localhost ~]# useradd sam

Syntax:
[root@localhost~]# gpasswd -M <userl>,<user2>,<user3> <group_name>
[root@localhost ~]# gpasswd -M jack,sam,wiliam zoomgroup

Verification:
[root@localhost ~]# grep zoomgroup /etc/group
zoomgroup:x:1000:jack;sam;wiliam

6. To add user in a group as a Secondary member Note: Before you add user into
group create a user [root@localhost ~]# useradd ravi

Sy ntax:
[root@localhost ~]# usermod -G <groupname> <username>
[root@localhost ~]# usermod -G zoomgroup ravi

Verification:
[root@localhost ~]# grep zoomgroup /etc/group
zoomgroup:x:1000:jack;sam,wiliam,ravi

7. To add user in a group as a primary member


Note: Before you add user into group create a user
[root@localhost ~]# useradd Ali

Syntax:
[root@localhost ~]# usermod -g <groupname> <username>
[root@local host ~]# usermod -g zoomgroup Ali

Verification:
[root@localhost ~]# su - Ali [Ali@localhost~]$ id
uid=1004(Ali) gid=1000 (zoomgroup) groups=1000(zoomgroup)
context=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.cl023

8. Removing user wiliam from zoomgroup

Syntax:
[root@localhost ~]# gpasswd -d <user_name> <group_name>
[root@localhost ~]# gpasswd -d wiliam zoomgroup

Verification:
[root@localhost ~]# grep zoomgroup /etc/group
zoomgroup^lOOCkjackjSarrvavi

Deleting a group Syntax:


[root@localhost ~]# groupdel <group_name>
[root@localhost ~]# groupdel zoomgroup
Note: If group contains any primary member, it cannot be deleted unless the gid of
that member is changed.
Verification:
[root@local host ~]# grep zoomgroup /etc/group
No group details will be displayed.
END

You might also like