useradd

Linux · Users and permissions · available in the simulator

What it does

Create a new user account on the system.

Syntax

useradd [opciones] usuario

Options and parameters

  • -m

    Create the user's home directory.

    sudo useradd -m ana
  • -s

    Define the default login shell.

    sudo useradd -s /bin/bash ana
  • -G

    Add the user to the specified supplementary groups.

  • -g

    Define the user's primary group.

  • -d

    Path to the home directory.

  • -e

    Account expiration date.

Usage examples

  • sudo useradd -m ana
  • sudo useradd -s /bin/bash ana
Practise useradd

Related commands