🎁 New User? Get 20% off your first purchase with code NEWUSER20 Register Now →
Menu

Categories

adduser Command

Beginner User Management man(1)

Add a user to the system (interactive, Debian-based)

👁 9 views 📅 Updated: Mar 15, 2026
SYNTAX
adduser [OPTION]... USERNAME

What Does adduser Do?

adduser is an interactive, user-friendly command for creating new user accounts. It is a higher-level wrapper around useradd that automatically creates the home directory, copies skeleton files, prompts for a password, and asks for user details.

adduser is specific to Debian/Ubuntu systems. On RHEL/CentOS, adduser is a symlink to useradd. The interactive prompts make adduser ideal for manual user creation, while useradd is better for scripts.

adduser can also add users to groups when used as adduser user group.

Options & Flags

OptionDescriptionExample
username Create a new user interactively sudo adduser jdoe
--disabled-password Create user without password prompt sudo adduser --disabled-password jdoe
--system Create a system user sudo adduser --system --no-create-home appuser
--group Create a group instead of user sudo adduser --group developers
user group Add existing user to group sudo adduser jdoe sudo
--home Specify home directory sudo adduser --home /opt/user jdoe

Practical Examples

#1 Create user interactively

Creates user with interactive prompts for password, name, phone, etc.
$ sudo adduser jdoe
Output: Adding user jdoe...\nEnter new UNIX password:

#2 Add user to group

Adds existing user jdoe to the sudo group.
$ sudo adduser jdoe sudo
Output: Adding user jdoe to group sudo...

#3 Create without password

Creates user non-interactively (for scripts). --gecos sets the name.
$ sudo adduser --disabled-password --gecos "John Doe" jdoe

#4 Create system user

Creates a system user and group for running a service.
$ sudo adduser --system --group --no-create-home nginx

#5 Add to Docker group

Adds current user to docker group (logout/login required to take effect).
$ sudo adduser $USER docker

Tips & Best Practices

adduser for groups: adduser username groupname adds a user to a group. This is simpler than usermod -aG groupname username.
Debian/Ubuntu only: The interactive adduser is a Debian/Ubuntu tool. On RHEL/CentOS, adduser is just a symlink to useradd.
Group changes need re-login: After adding a user to a group, they must log out and back in (or use newgrp) for the change to take effect.

Frequently Asked Questions

How do I add a user to a group?
Use sudo adduser username groupname. The user must log out and back in for group changes to take effect.
What is the difference between adduser and useradd?
adduser is interactive and user-friendly (Debian/Ubuntu). useradd is low-level and non-interactive. Use adduser manually, useradd in scripts.
How do I create a user without a password prompt?
sudo adduser --disabled-password --gecos "Full Name" username. The --gecos flag sets the name without prompting.

Master Linux with Professional eBooks

Curated IT eBooks covering Linux, DevOps, Cloud, and more

Browse Books →