usermod [options] usernameArguments explained
- username is the account to modify.
- -aG appends supplementary groups.
- -s changes shell.
- -L locks the password.
- -U unlocks.
Common examples
sudo usermod -aG docker alexAdds alex to docker without removing existing groups.
sudo usermod -s /bin/zsh alexSets alex's login shell to Zsh.
| Field | Details |
|---|---|
| Command | usermod |
| Category | User and Group Management |
| Primary use | Modifies existing user accounts. |
| Syntax | usermod [options] username |