How-to

useradd vs adduser: Which One to Use

Both create accounts. On Debian they behave very differently; on Rocky Linux and AlmaLinux they are the same program. Knowing which you have avoids surprises.

What is the short version?

useradd is the low-level tool from the shadow-utils suite, present on every Linux system. It does exactly what its flags say and nothing else. adduser on Debian and Ubuntu is a separate, friendlier program that asks questions, creates a home folder, copies skeleton files and sets a password interactively. On Rocky Linux, AlmaLinux and CentOS Stream, adduser is just a link to useradd, so they behave identically.

How do they differ on each system?

Behavioruseradd on Debian/Ubuntuadduser on Debian/Ubuntuuseradd/adduser on Enterprise Linux
Creates home folderOnly with -mYesYes (login.defs)
Default shell/bin/sh/bin/bash/bin/bash
Asks for passwordNoYesNo
Copies /etc/skelWith -mYesYes
Config file/etc/default/useradd/etc/adduser.conf/etc/default/useradd
LanguageC binaryPerl scriptC binary

The Debian row explains a frequent question: "I created a user with useradd and it has no home folder and a strange shell." On Debian and Ubuntu that is the documented default.

What does adduser do in one interactive run?

sudo adduser marek
# Adding user `marek' ...
# Adding new group `marek' (1004) ...
# Creating home directory `/home/marek' ...
# New password:

It picks the next free UID, creates a matching group, builds the home folder with the mode set in /etc/adduser.conf, copies /etc/skel, then asks for a password and optional details. Debian's adduser also adds new users to groups listed in EXTRA_GROUPS when ADD_EXTRA_GROUPS=1 is set in its config. It is the comfortable choice for a person typing at a terminal.

Which one should scripts use?

useradd, with explicit flags. It exists everywhere, never prompts, and its behavior is spelled out on the command line:

useradd -m -s /bin/bash -U -G developers -c "Marek, backend" marek

Ansible, cloud-init and most provisioning tools call useradd under the hood for that reason. If you need a non-interactive Debian adduser, adduser --disabled-password --comment "Marek" marek works; older releases used --gecos for the comment, which newer ones deprecate. Flag-by-flag usage of useradd is in Create a Linux user.

Do both handle system accounts?

Yes. useradd --system --shell /usr/sbin/nologin --home-dir /var/lib/metrics metrics creates a service account with a low UID. Debian's adduser --system metrics does the same and, by default, gives it nologin and no password. Packages typically use the Debian form in their install scripts, or systemd's sysusers.d files, which declare service accounts in a tiny config format and create them at boot.

What about deletion?

The pairs continue: userdel is the low-level tool and deluser the Debian wrapper. deluser --remove-home marek matches userdel -r marek. Debian's deluser can also back up the home folder first with --backup, which is a pleasant extra when retiring an account. The full lifecycle is in Linux user management.

How do I check what a command will do before running it?

Read the defaults first. useradd -D prints the shell, home base and skeleton folder that useradd applies when you pass no flags, and grep -vE '^(#|$)' /etc/adduser.conf shows what Debian's adduser will do. Thirty seconds of reading avoids an account with the wrong shell, a missing home folder or an unexpected UID that later clashes with files copied from another machine.

And on FreeBSD?

FreeBSD 14 has neither useradd nor Debian's adduser. It offers an interactive adduser shell script and the scriptable pw useradd. The idea maps cleanly: interactive for people, pw for scripts.

Which should I teach my team?

Teach useradd with explicit flags as the standard, because it works on every image you might install, from Ubuntu to Rocky Linux. Mention adduser as a convenience on Debian and Ubuntu, and point to The adduser command for its options. Whatever the tool, finish every account the same way: check with id, install an SSH key and add groups with usermod -aG, as shown in Add a user to a group.

Keep Reading

Create a Linux user

Create human and service accounts with useradd: home folders, shells, UIDs, groups, expiry, skeleton files and system accounts.

Open

The adduser command

Debian and Ubuntu adduser in depth: interactive creation, non-interactive flags, adding users to groups and the settings in adduser.conf.

Open

Linux user management

The full life of an account on a server: create, group, change, expire, lock, audit and delete, with the files behind each step.

Open

Ubuntu

Ubuntu 24.04 or 22.04 LTS on a whole machine: the default pick when you want the biggest pool of packages and how-tos.

Open

FAQ

Quick Answers

On Rocky Linux and AlmaLinux yes, it is a link. On Debian and Ubuntu adduser is a separate interactive script.

Debian-family useradd needs -m to create one. adduser creates it by default.

useradd with explicit flags, because it exists everywhere and never prompts.

/bin/sh by default. Pass -s /bin/bash for a normal login shell.

pw useradd for scripts and the interactive adduser script for people.