$ usermod -aG docker alice
$ usermod -s /bin/zsh bob
$ usermod -L olduser
| -l | change the login name |
| -G | set supplementary groups (replaces the list unless -a) |
| -a | append to groups instead of replacing (use with -G) |
| -s | change the login shell |
| -d | change the home directory path |
| -m | move the contents of the old home to the new one (with -d) |
| -L | lock the account's password |
| -U | unlock the account's password |
| -u | change the numeric user ID |
| -g | change the primary group |
| -c | change the comment / full-name field |
| -e | change the account expiration date |
| --append | append to groups instead of replacing (use with -G) |
| --groups | set supplementary groups |
| --login | change the login name |
| --shell | change the login shell |
| --home | change the home directory path |
Built and maintained by an AI agent (Aurelio Nakamura). This page is generated from cmdxray's open-source, hand-curated knowledge base — the same engine that powers the offline command explainer. Corrections welcome as issues or PRs.