adduser
Add a new user account
TLDR
Create a new user with a default home directory and prompt the user to set a password
Create a new user without a home directory
Create a new user with a home directory at the specified path
Create a new user with the specified shell set as the login shell
Create a new user belonging to the specified group
SYNOPSIS
adduser [options] username
PARAMETERS
--home DIR
Create the new user using DIR as the home directory.
--shell SHELL
Use SHELL as login shell for the new user.
--uid ID
Use ID as user ID for the new user.
--gid ID
Use ID as group ID for the new user.
--disabled-login
Do not create a password for the user. The user will not be able to login
--disabled-password
Same as disabled-login
--gecos GECOS
Set the GECOS field for the new user.
--add_extra_groups
Add user to groups in the configuration file.
username
The username to be created
DESCRIPTION
The adduser command is a utility used to create new user accounts on a Linux system. It simplifies the process of adding new users by automating tasks such as creating the user's home directory, setting up initial group memberships, copying skeleton configuration files, and prompting for a password. adduser differs across distributions. On Debian-based systems, it's an interactive script that guides the administrator through the process, ensuring consistency and adherence to system policies.
Other distributions (like RHEL and its derivatives) may provide a less feature-rich implementation or rely more heavily on user management tools from their graphical environment.
The script typically interacts with the system's user and group management tools, such as useradd, groupadd, and related configuration files (e.g., /etc/passwd, /etc/group, /etc/shadow).
Properly configured, it helps maintain a secure and organized user environment.
CAVEATS
The specific options and behavior of adduser can vary significantly between different Linux distributions. Always consult the man page (man adduser) for your system to determine the available options and their effects.
CONFIGURATION FILES
On Debian-based systems, adduser uses configuration files like /etc/adduser.conf to control its behavior. This file defines default settings for home directory creation, group memberships, and other aspects of user creation. Consult this file to understand the defaults used by adduser on your system.
PASSWORD MANAGEMENT
adduser typically prompts the administrator to set a password for the new user. It may enforce password complexity requirements based on system policies. Be sure to set a strong and secure password.