English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
The Linux adduser command is used to add user accounts or update default user information.
The adduser and useradd commands are the same command (via symbolic link).
Access Permission: System Administrator.
adduser is used to add users. Conversely, there is also a command to delete users, userdel.Syntax:userdel [login ID]
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:
Add a general user
# useradd kk //Add user kk
Specify the corresponding user group for the added user
# useradd -g root kk //Add user kk and specify the group of the user as the root user group
Create a system user
# useradd -r kk //Create a system user kk
Specify the home directory for the newly added user/Home Directory
# useradd-d /home/myf kk //The home directory of the newly added user kk is/home/myf //When the user kk logs in to the host, the default directory entered by the system is/home/myf