useradd command
Create user accounts.
- Users & permissions
- Package passwd / shadow-utils
- 7 options · 7 examples
Syntax
useradd [options] usernameadduser username (Debian/Ubuntu)
Provided by the passwd / shadow-utils package. Run man useradd for the full manual.
Common options
| Option | What it does |
|---|---|
-m | Create the home directory |
-s SHELL | Login shell |
-G GROUPS | Extra groups |
-u UID | User ID |
-r | System account |
-d DIR | Home directory path |
-e DATE | Account expiry date |
Examples
Create a user with a home and Bash
sudo useradd -m -s /bin/bash aliceSet the password
sudo passwd aliceInteractive (Ubuntu/Debian)
sudo adduser aliceCreate a user with sudo rights (Ubuntu)
sudo useradd -m -s /bin/bash -G sudo aliceCreate a user with sudo rights (RHEL)
sudo useradd -m -G wheel aliceSystem user for a service
sudo useradd -r -s /usr/sbin/nologin appuserDelete a user and their home
sudo userdel -r alice
No example matches. Check the options table or search the guides.
useradd guides
- How to Create a Sudo User on MX Linux Linux · Updated Apr 2025
- How to Create a sudo User on Ubuntu Linux Commands · Updated Apr 2025
- How to Create a Sudo User on Fedora Linux Commands · Updated Apr 2025
- How to Create a Sudo User in Debian Linux · Updated Apr 2025
