O'Reilly logo

Linux in a Nutshell, 6th Edition by Robert Love, Stephen Figgins, Ellen Siever, Arnold Robbins

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required