useradd

>Usage

The useradd command is used for creating a new user on the system.

>Synopsis

useradd [option] username

>Options

-c

This option adds a comment (usually the full name or description) to the user account.

Example:

Dots

-zsh

> useradd -c "this is a test user" test_user


#this command doesn't return an output.

-e

This option sets an expiration date (yyyy-mm-dd)for the user account. after this date it will be disabled.

Example:

Dots

-zsh

> useradd -e 2024/07/07 test_user


#this command doesn't return an output.

-d

This option gives a home directory path for new users.

Example:

Dots

-zsh

> useradd -d /home/test_user test_user


#this command doesn't return an output.

-p

This option sets an unencrypted password for the user.

Example:

Dots

-zsh

> useradd -p test_password test_user


#this command doesn't return an output.

-g

This option assignes to the created user a specific group ID .

Example:

Dots

-zsh

> useradd -g 1234 test_user


#this command doesn't return an output.

>Quiz

Progress: Question ? out of ?

Question Title

Page written by Gabriele Siliprandi