terminal.cab

All commands

useradd

Topic: Users

Program: useradd

Creates a new user.

Package: users

Usage

useradd [OPTION]... LOGIN

Description

Create the user LOGIN in /etc/passwd and /etc/shadow, with a group of the same name. Only root may do this.

Options in the simulator

17 more options of the real program, not in the simulator yet
  • --badname not in the simulator yet

    This option exists on a real system; the simulator cannot do it for this command yet.

  • -b, --base-dir needs a value not in the simulator yet

    This option exists on a real system; the simulator cannot do it for this command yet.

  • --btrfs-subvolume-home not in the simulator yet

    This option exists on a real system; the simulator cannot do it for this command yet.

  • -D, --defaults not in the simulator yet

    useradd -D shows or changes the defaults in /etc/default/useradd; the simulator uses the fixed defaults of Debian 13.

  • -e, --expiredate needs a value not in the simulator yet

    This option exists on a real system; the simulator cannot do it for this command yet.

  • -f, --inactive needs a value not in the simulator yet

    This option exists on a real system; the simulator cannot do it for this command yet.

  • -F, --add-subids-for-system not in the simulator yet

    This option exists on a real system; the simulator cannot do it for this command yet.

  • -k, --skel needs a value not in the simulator yet

    This option exists on a real system; the simulator cannot do it for this command yet.

  • -K, --key needs a value not in the simulator yet

    This option exists on a real system; the simulator cannot do it for this command yet.

  • -N, --no-user-group not in the simulator yet

    This option exists on a real system; the simulator cannot do it for this command yet.

  • -o, --non-unique not in the simulator yet

    This option exists on a real system; the simulator cannot do it for this command yet.

  • -p, --password needs a value not in the simulator yet

    This option exists on a real system; the simulator cannot do it for this command yet.

  • -R, --root needs a value not in the simulator yet

    This option exists on a real system; the simulator cannot do it for this command yet.

  • -P, --prefix needs a value not in the simulator yet

    This option exists on a real system; the simulator cannot do it for this command yet.

  • -U, --user-group not in the simulator yet

    This option exists on a real system; the simulator cannot do it for this command yet.

  • -Z, --selinux-user needs a value not in the simulator yet

    This option exists on a real system; the simulator cannot do it for this command yet.

  • --selinux-range needs a value not in the simulator yet

    This option exists on a real system; the simulator cannot do it for this command yet.

Examples

From the lesson Users and groups
sudo useradd -m -s /bin/bash -G adm anna
id anna
uid=1002(anna) gid=1002(anna) groups=1002(anna),4(adm)
getent passwd anna
anna:x:1002:1002::/home/anna:/bin/bash

Try it in the terminal

Where you learn it

Lessons

All commands