Modifying User Groups & Shell (usermod)
Concept & Overview
When onboarding engineers or automation service accounts, you must configure their supplementary group memberships and default login shells. In Linux, usermod modifies existing accounts in /etc/passwd and /etc/group.
- -aG : Appends the user to supplementary groups without removing them from existing groups. (CRITICAL: omitting -a would replace all existing secondary groups!).
- -s : Specifies the new login shell (e.g. /bin/bash or /usr/sbin/nologin).
deployer to the sudo group using sudo usermod -aG sudo deployer, then change their login shell to bash using sudo usermod -s /bin/bash deployer.Command Syntax Reference
| Command / Syntax | Description |
|---|---|
sudo usermod -aG sudo deployer | Append user deployer to administrative sudo group |
sudo usermod -s /bin/bash deployer | Set default shell to bash for user |
Verification Objectives
These conditions will be automatically verified when you run commands inside the interactive terminal simulator:
- ○Add deployer to sudo group with usermod -aG
- ○Update deployer login shell to /bin/bash
Ready to complete Quest 141?
Test your skills live in the browser terminal with an emulated Linux filesystem, real-time command evaluation, and instant step-by-step hints.