Question: Part 2 Groups and Usermod: In this lab, you will practice using the usermod command to manage user accounts and groups in a Linux environment.

Part 2 Groups and Usermod:
In this lab, you will practice using the usermod command to manage user accounts
and groups in a Linux environment. You will learn how to modify user attributes such
as the username, primary group, supplementary groups, home directory, login shell,
and expiration date.
Instructions:
Create Test Users and Groups:
Create two test users named user1 and user2 using the useradd command.
Create two test groups named group1 and group2 using the groupadd command.
Modify User Attributes:
Use the usermod command to modify the attributes of user1 and user2 as
follows:
Change the username of user1 to newuser1.
Set the primary group of user1 to group1.
Add user2 to the supplementary groups group1 and group2.
Change the home directory of user2 to /home/customhome.
Change the login shell of user2 to /bin/ksh, or csh, or sh, which ever is available
Set an expiration date for user2's account to one week from the current date.
Verify Changes:
Use appropriate commands (id, grep, cat /etc/passwd, etc.) to verify that the
modifications made to user accounts and groups have been applied correctly.
Cleanup:
Remove the test users and groups created during the lab using the userdel and
groupdel commands.
Tips:
Use the man command to read the manual pages for usermod and useradd to
understand their usage and options.
Make sure to execute usermod commands with administrative privileges using sudo
or as the root user.
Double-check your modifications to user accounts and groups before proceeding
with verification to ensure accuracy.
Pay attention to the syntax of commands and options to avoid errors.
Please provide screenshots for each command in the submitted documen

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!