Users

The useradd command

Creates a new user account. It requires administrator privileges.

Syntax

sudo useradd <usuario>

Most useful options

-mCreates their home folder
-sSets their shell

Copy-ready examples

$ sudo useradd ayudanteCreate an account
$ cat /etc/passwdCheck that it exists

You can try them in the browser terminal: it does not touch your computer.

Typical mistakes

  • Without -m it does not create the home folder on many distributions.

Related commands

FAQ

How do I set a password?

With sudo passwd name, right after creating it.

Learn to actually use it

The basic Linux course takes you from zero to console fluency with 24 self-grading lessons.

Start the free course