Easy Tutorial
❮ Linux Comm Mcopy Linux Comm Makedev ❯

Linux adduser Command

Linux Command Manual

The Linux adduser command is used to add a new user account or update the default user information.

adduser and useradd are the same command (via symbolic link).

Usage permission: System administrator.

adduser is used to add a user. Conversely, there is also a command to delete a user, userdel, with the syntax userdel [login ID].

Syntax

adduser [-c comment] [-d home_dir] [-e expire_date] [-f inactive_time] [-g initial_group] [-G group[,...]] [-m [-k skeleton_dir] | -M] [-p passwd] [-s shell] [-u uid [ -o]] [-n] [-r] loginid

or

adduser -D [-g default_group] [-b default_home] [-f default_inactive] [-e default_expire_date] [-s default_shell]

Parameter Description:

Example

Add a regular user

# adduser kk //Add user kk

Specify a user group for the added user

# adduser -g root kk //Add user kk and specify the user group as root

Create a system user

# adduser -r kk //Create a system user kk

Specify the /home directory for the new user

# adduser -d /home/myf kk //Add user kk with home directory /home/myf
//When user kk logs in, the default directory is /home/myf

Linux Command Manual

❮ Linux Comm Mcopy Linux Comm Makedev ❯