Linux Comm Adduser
# Linux adduser Command
[ Linux Command Manual](#)
The Linux `adduser` command is used to add a new user account or update default user information.
The `adduser` and `useradd` commands are the same command (via a symbolic link).
Permission required: System administrator.
`adduser` is for adding users. Conversely, there is a command to delete users: (#), with the syntax `userdel `.
### Syntax
`adduser [-G group[,...]] [-m | -M] [-u uid ] loginid`
or
`adduser -D `
**Parameter Description**:
* `-c comment` Comment information for the new user in the password file (usually `/etc/passwd`).
* `-d home_dir` Sets the user's home directory to `home_dir`. The default value is the default home directory plus the user's login ID.
* `-e expire_date` Sets the expiration date for this account (format: YYYY-MM-DD). The default value is permanent validity.
* `-f inactive_time` Example:
### Examples
Add a regular user
`# adduser kk //Add user kk`
Specify the corresponding user group for the added user
`# adduser -g root kk //Add user kk and specify the user's group as the root group`
Create a system user
`# adduser -r kk //Create a system user kk`
Specify the /home directory for the newly added user
`# adduser -d /home/myf kk //Add new user kk, with home directory /home/myf//When the user kk logs in, the system enters the default directory /home/myf`
[ Linux Command Manual](#)
YouTip