Create a New User with useradd
Add a local account with home directory and shell in one command, then set its password.
Run sudo useradd -m -s /bin/bash alice to create the account and home directory, then sudo passwd alice to set a password.
01Command
Command
$ sudo useradd -m -s /bin/bash alice && sudo passwd alice02What it does
-m creates /home/alice populated from /etc/skel, without it the account has no home directory and many apps misbehave; -s picks the login shell. useradd deliberately does not set a password — the new account stays locked (usable only via sudo su) until you run passwd for it. On desktop distros adduser is a friendlier interactive wrapper, but useradd is the portable, scriptable core tool.
03Risk
!Warning: Creating accounts without setting a password or SSH key leaves a locked, easy-to-forget account; check /etc/login.defs for your distro HOME_MODE defaults.
04Undo
Undo
$ sudo userdel -r alice05Sources
- useradd(8) — create a new userEvidence: Documents -m/--create-home and -s/--shell options plus -c comment; confirmed the strings -m, --create-home and -s in the man page text.
- useradd(8) — Debian man page (passwd)Evidence: Man page documents -m creating the user home directory and -s setting the login shell; text contains -m and create home descriptions.
Last verified: 2026-09-19 · Category: System & Settings