Gain practical experience with essential Linux commands for user and group management.
Scenario:
Imagine you are the system administrator for a new web development team. You need to create user accounts for three developers: Alice, Bob, and Charlie. These users will also need to be part of a group called "webdev" to access project files and resources.
Tasks:
Create Users:
Use the useradd command to create user accounts for Alice, Bob, and Charlie.
Refer to the cheat sheet for the syntax and options available with useradd.
Hint: Consider using the -m option to create a home directory for each user.
Set Passwords:
Use the passwd command to set initial passwords for each user.
Important Note: When prompted, enter the new password but avoid typing it here for security reasons.
Verify User Information:
Use the id command to display information about each user, including their user ID (UID) and group ID (GID).
Create a Group:
Use the groupadd command to create a new group called "webdev".
Add Users to a Group:
Use the usermod command to add Alice, Bob, and Charlie to the "webdev" group.
Refer to the cheat sheet for the syntax and options available with usermod.
Verify Group Membership:
Use the groups command to list the groups each user belongs to. This should confirm that Alice, Bob, and Charlie are now members of the "webdev" group.
Bonus Challenge:
Explore the gpasswd command. What can you do with it related to groups?
Remember:
It's recommended to practice these commands in a safe, non-production environment to avoid impacting real user accounts.
Pay close attention to the options available with each command and use them appropriately.
When setting passwords, remember to choose strong and unique passwords for each user.
Further Exploration:
After completing these tasks, try experimenting with additional options and functionalities of the covered commands.
Explore online resources for more advanced user and group management techniques in Linux.
Create Users:
useradd Alice
useradd Bob
useradd Charlie
Set passwords:
passwd Alice
passwd Bob
passwd Charlie
Verify User Information: Use the id command to display information about each user, including their user ID (UID) and group ID (GID).
id Alice
id Bob
id Charlie
Create a Group:
groupadd webdev
Add User to a Group
usermod -aG webdev Alice
usermod -aG webdev Bob
usermod -aG webdev Charlie
Task Objective:
Gain practical experience with essential Linux commands for user and group management.
Scenario:
Imagine you are the system administrator for a new web development team. You need to create user accounts for three developers: Alice, Bob, and Charlie. These users will also need to be part of a group called "webdev" to access project files and resources.
Tasks:
Create Users:
useradd
command to create user accounts for Alice, Bob, and Charlie.useradd
.-m
option to create a home directory for each user.Set Passwords:
passwd
command to set initial passwords for each user.Verify User Information:
id
command to display information about each user, including their user ID (UID) and group ID (GID).Create a Group:
groupadd
command to create a new group called "webdev".Add Users to a Group:
usermod
command to add Alice, Bob, and Charlie to the "webdev" group.usermod
.Verify Group Membership:
groups
command to list the groups each user belongs to. This should confirm that Alice, Bob, and Charlie are now members of the "webdev" group.Bonus Challenge:
gpasswd
command. What can you do with it related to groups?Remember:
Further Exploration: