farnodes / sysadmin

0 stars 0 forks source link

User and Group Management #1

Open swetank01 opened 1 month ago

swetank01 commented 1 month ago

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:

  1. 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.
  2. 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.
  3. Verify User Information:

    • Use the id command to display information about each user, including their user ID (UID) and group ID (GID).
  4. Create a Group:

    • Use the groupadd command to create a new group called "webdev".
  5. 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.
  6. 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:

Remember:

Further Exploration:

rsingh0706 commented 1 month ago
  1. Create Users: useradd Alice useradd Bob useradd Charlie
  2. Set passwords: passwd Alice passwd Bob passwd Charlie
  3. 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
  4. Create a Group: groupadd webdev
  5. Add User to a Group usermod -aG webdev Alice usermod -aG webdev Bob usermod -aG webdev Charlie
  6. verify Group Membership vim /etc/passwd