In this lab, you will add users to newly created supplementary groups.
Outcomes
The shakespeare group consists of juliet, romeo, and hamlet. The artists group contains reba, dolly, and elvis.
Perform the following steps on serverX unless directed otherwise.
Become the root user at the shell prompt.
[student@serverX ~]$su -Password:redhat
Create a supplementary group called shakespeare with a group ID of 30000.
[root@serverX ~]#groupadd -g 30000 shakespeare
Create a supplementary group called artists.
[root@serverX ~]#groupadd artists
Confirm that shakespeare and artists have been added by
examining the /etc/group file.
[root@serverX ~]#tail -5 /etc/groupreba:x:1004: dolly:x:1005: elvis:x:1006: shakespeare:x:30000: artists:x:30001:
Add the juliet user to the shakespeare group as a supplementary group.
[root@serverX ~]#usermod -G shakespeare juliet
Confirm that juliet has been added using the id command.
[root@serverX ~]#id julietuid=1001(juliet) gid=1001(juliet) groups=1001(juliet),30000(shakespeare)
Continue adding the remaining users to groups as follows:
Add romeo and hamlet to the shakespeare group.
[root@serverX ~]#usermod -G shakespeare romeo[root@serverX ~]#usermod -G shakespeare hamlet
Add reba, dolly, and elvis to the artists group.
[root@serverX ~]#usermod -G artists reba[root@serverX ~]#usermod -G artists dolly[root@serverX ~]#usermod -G artists elvis
Verify the supplemental group memberships by
examining the /etc/group file.
[root@serverX ~]#tail -5 /etc/groupreba:x:1004: dolly:x:1005: elvis:x:1006: shakespeare:x:30000:juliet,romeo,hamlet artists:x:30001:reba,dolly,elvis