srmdn.

Back

Ever wondered why Linux has two commands for the same task?Blur image

Creating a user seems simple, but choosing the wrong tool can leave you with a “broken” account (no home directory, no shell!).

The Core Difference#

Think of it this way:#

  • useradd: The raw, low-level tool. It’s a binary that does exactly what it’s told, nothing more.

  • adduser: The smart, high-level wrapper (Perl script). It uses useradd in the background but adds “common sense” automation.

The “useradd” Way (The Hard Way)#

If you run sudo useradd john: No home directory created. No password set (account is locked). Default shell is often /bin/sh (very basic).

You have to manually add flags like -m for home or -s for shell. It’s built for scripts, not humans.

The “adduser” Way (The Easy Way)#

If you run sudo adduser john: Automatically creates /home/john. Copies skeleton files (.bashrc, etc.). Prompts you for a password immediately. Asks for user details (Full name, room number).

It’s interactive and “just works.”

Practice#

If you’re managing an ubuntu server, creating the user is just step 1. You’ll likely want them to have admin rights:

sudo adduser username
sudo usermod -aG sudo username
plaintext

Now your new user can perform administrative tasks!

When to use which?#

Use adduser if:#

  • You are a beginner.

  • You are working on Debian/Ubuntu-based systems.

  • You want a ready-to-use account in 10 seconds.

Use useradd if:#

  • You are writing bash scripts.

  • You are on a minimal distro (Arch, Alpine) where adduser might not be installed.

Pro-Tip: The “Skel” Directory#

Both commands rely on /etc/skel. Anything you put in this folder will automatically appear in a new user’s home directory. Perfect for pre-configuring .vimrc or alias settings for your team!

Wait, why do some tutorials say they are the same?#

  • In Debian/Ubuntu, they are different: adduser is a friendly script, useradd is the raw tool.

  • In RHEL/CentOS/Fedora, adduser is often just a symbolic link to useradd.

Know your distro before you type!

To summarize for my ubuntu server friends:#

  • Use adduser for a fast, interactive, and “complete” setup.

  • Use useradd only if you’re writing automated scripts. Mastering these small nuances is what makes a great sysadmin!

Enjoyed this post?

Get Linux tips, sysadmin war stories, and new posts delivered to your inbox.

No spam. Unsubscribe anytime.

Ever wondered why Linux has two commands for the same task?
https://srmdn.com/blog/useradd-and-adduser
Author srmdn
Published at January 6, 2026