Introduction
In this challenge, you will learn how to create, delete, and modify local groups on a Red Hat Enterprise Linux system. This is an essential skill for system administrators to manage user access and permissions effectively.
Create a New Local Group
Your first task is to create a new local group. This is a common administrative task for organizing users with similar access needs.
Tasks
- Create a new local group named
developers.
Requirements
- The new group must be created using the
groupaddcommand. - The group name must be exactly
developers.
Example
After creating the new group, you can verify its existence by checking the /etc/group file or using the getent command. The output should be similar to the following, though the Group ID (GID) may differ:
developers:x:1001:
Add a User to a Group
Now that the developers group exists, you will add an existing user to it. This grants the user the permissions associated with that group.
Tasks
- Add the user
johnto thedevelopersgroup.
Requirements
- The user
johnmust be added to thedevelopersgroup as a supplementary group. - Use the
usermodcommand to modify the user's group membership. - Ensure that
john's primary group is not changed.
Example
After adding john to the group, you can check his group memberships with the id command. The output should show developers in the list of groups.
uid=1002(john) gid=1003(john) groups=1003(john),1002(developers)
Remove a User from a Group
Next, you will practice removing a user from a group. This is a common task when a user's role changes and they no longer need access associated with a particular group.
Tasks
- Remove the user
johnfrom thedevelopersgroup.
Requirements
- The user
johnmust be removed from thedevelopersgroup using thegpasswdcommand. - The user
johnmust still exist on the system after being removed from the group.
Example
After removing john from the developers group, the id john command should no longer list developers in his group memberships.
uid=1002(john) gid=1003(john) groups=1003(john)
Delete a Group
Finally, you will delete the developers group entirely. This is done when a group is no longer needed.
Tasks
- Delete the
developersgroup.
Requirements
- The
developersgroup must be deleted using thegroupdelcommand. - After deletion, the group should no longer exist on the system.
Example
After deleting the developers group, running getent group developers will produce no output, confirming that the group has been removed.
getent group developers
(This command will produce no output and exit with a non-zero status code.)
Summary
In this challenge, you have learned the fundamental operations for managing local groups on a Red Hat Enterprise Linux system. You practiced creating a group with groupadd, adding a user to a group with usermod, removing a user from a group with gpasswd, and deleting a group with groupdel. These commands are essential tools for any system administrator responsible for user and access management.



