Objective

Hands-on practice with user & group administration in a Linux environment.

Tools & Technologies

  • useradd
  • usermod
  • groupadd
  • passwd
  • sudo

Key Commands

useradd -m -s /bin/bash -G sudo alice
usermod -aG docker bob
passwd alice
visudo

Lab Steps

01
Creating Users

Create users with useradd, setting home directory, shell, and initial groups.

02
Group Management

Create groups and add users to supplementary groups with usermod -aG.

03
Password Policy

Set passwords and configure expiry with chage and /etc/login.defs.

04
sudo Access

Configure sudo access via /etc/sudoers using visudo for safe editing.

Challenges Encountered

  • usermod -G replaces all groups — use -aG to append
  • visudo prevents syntax errors that could lock you out

Key Takeaways

  • Never edit /etc/sudoers directly — always use visudo
  • Use /etc/sudoers.d/ for modular sudo configuration