AddUser

adduser(8) creates a user.


Installation

Linux and BSD distributions will either have adduser(8) pre-installed, or direct users to instead use useradd(8).


Usage

To create a new user, consider using adduser(8) interactively, by calling just the binary name.

To add a user to a group, try:

adduser USERNAME GROUPNAME

When using adduser(8) in a script, it can be important to consider portability. The BusyBox implementation only supports the following short-form flags.

adduser [OPTIONS] USER [GROUP]
Create new user, or add USER to GROUP
    -h DIR      Home directory
    -g GECOS    GECOS field
    -s SHELL    Login shell
    -G GRP      Add user to existing group
    -S          Create a system user
    -D          Don't assign a password
    -H          Don't create home directory
    -u UID      User id
    -k SKEL     Skeleton directory (/etc/skel)

It's typical to explicitly create the user group with addgroup(8) as well.

addgroup example
adduser -D -h /var/example -s /bin/nologin -G example example


See also

adduser(8)


CategoryRicottone

AddUser (last edited 2023-06-29 16:43:47 by DominicRicottone)