useradd
UsersFundamentals In real LinuxCreate a new user
Name: useradd = user add
This command needs a real Linux system; you can practise it in real Linux mode.
Description
useradd is the low-level tool to create user accounts. It may not create a home directory or set a password by default, so you typically add -m (home) and -s (shell), then set a password with passwd.
On Debian/Ubuntu the interactive adduser is friendlier.
Syntax
useradd [OPTION]... USERCommon options
| -m / --create-home | Create the home directory |
| -d / --home-dir DIR | The home directory (/home/NAME by default) |
| -s / --shell SHELL | Login shell |
| -g / --gid GROUP | The primary group |
| -G / --groups GROUPS | Supplementary groups |
| -u / --uid UID | User ID |
| -c / --comment COMMENT | A comment (usually the full name) |
| -r / --system | A system user (for a service, no home directory) |
| -e / --expiredate DATE | The account expires on DATE, e.g. 2026-12-31 |