Introduction
The LabEx R&D Team has one server where each team member has an account for daily routine jobs. Today, we have two new employees joining us, and we need to create their accounts.
Add New Users and Groups
In this challenge, you need to add two new users and two new groups to the system. You can accomplish this either by creating users and groups separately or by using a single command that sets up everything at once.
Tasks
- Create new groups named
devandtest. - Add a new user account named
jackwith a home directory of/home/jack, primary groupdev, and secondary grouplabex. - Add a new user account named
bobwith a home directory of/home/bob, primary grouptest, and secondary grouplabex.
Requirements
- Use the
labexuser, which hassudoprivileges and belongs to thelabexuser group, to perform these tasks. - Ensure that the new groups
devandtestare created before adding the users. - Ensure that the new users are created with their respective home directories and group memberships.
- You can choose either of these approaches:
- Create groups first, then create users, and finally add them to groups
- Create users with their group memberships in a single command
Examples
After completing the tasks, you should be able to verify the results as follows:
- For user
jack, the output should be similar to:
$ id jack
uid=5001(jack) gid=5003(dev) groups=5003(dev),5000(labex)
- For user
bob, the output should be similar to:
$ id bob
uid=5002(bob) gid=5004(test) groups=5004(test),5000(labex)
Summary
In this challenge, you learned how to add new groups and users to your system. You practiced creating groups, creating user accounts with specific home directories and primary groups, and adding users to additional groups. These skills are essential for user management in Linux systems, particularly when onboarding new team members or managing access control.



