User Management
usermod
Modify a user account — change shell, groups, home, expiry, and more.
Synopsis
syntax
usermod [OPTION]... LOGIN
Examples
Add alice to docker group
sudo usermod -aG docker alice
Change shell to zsh
sudo usermod -s /bin/zsh alice
Lock user account
sudo usermod -L alice
Add to multiple groups
sudo usermod -aG sudo,wheel alice
Common options
| Flag | Description |
|---|---|
| -aG | Append user to supplementary groups |
| -s | Change login shell |
| -d | Change home directory |
| -l | Change login name |
| -L | Lock the account |
| -U | Unlock the account |
About usermod
The `usermod` command modify a user account — change shell, groups, home, expiry, and more. User management commands handle creation, modification, and deletion of user accounts and groups.
Multi-user access control is a core feature of Linux. These commands are essential for system administrators managing servers, enforcing security policies, and provisioning access for teams.
The command accepts 6 commonly used flags shown above, though the full set of options is available in the man page (`man usermod`). The 4 examples on this page cover typical real-world usage patterns that you can copy and adapt for your own workflows.
Related commands
More User Management Commands
Other commands in the User Management category