Name

useradd

Synopsis

useradd [options] [user]

System administration command. Create new user accounts or update default account information. Unless invoked with the -D option, user must be given. useradd will create new entries in system files. Home directories and initial files may also be created as needed.

Options

-b dir, --base-dir dir

Specify base dir for home directories. The default is /home.

-c comment, --comment comment

Comment field.

-d dir, --home dir

Home directory. The default is to use user as the directory name under the home directory specified with the -D option.

-D [options]

Set or display defaults. If options are specified, set them. If no options are specified, display current defaults. The options are:

-b dir, --base-dir dir

Home directory prefix to be used in creating home directories. If the -d option is not used when creating an account, the user name is appended to dir.

-e date, --expiredate date

Expire date. Requires the use of shadow passwords.

-f days, --inactive days

Number of days after a password expires to disable an account. Requires the use of shadow passwords.

-g group, --gid group

Initial group name or ID number.

-s shell, --shell shell

Default login shell.

-e date, --expiredate date

Account expiration date. Use the format MM/DD/YYYY. Two-digit year fields are also accepted. The value is stored as the number of days since January 1, 1970. This option requires the use of shadow passwords.

-f days, --inactive days

Permanently disable account this many days after the password ...

Get Linux in a Nutshell, 6th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.