![Forrest logo](/images/logo.png)
useradd
The "useradd" command line tool is used in Unix-like operating systems to create a new user account. It is commonly used by system administrators to add new users to the system. By using the "useradd" command followed by the username, the tool creates a new entry in the system's user database. Additionally, the command creates a home directory for the user and assigns the default user group to them. The user's login name, user ID, and group ID can be specified as optional parameters during the creation process. The tool also provides various options to customize account settings such as password expiry, shell access, and user groups. Overall, the "useradd" command line tool simplifies the process of creating new user accounts on Unix-like systems.
List of commands for useradd:
-
useradd:tldr:3ff7a useradd: Create a new user with the specified user id.$ sudo useradd --uid ${id} ${username}try on your machineexplain this command
-
useradd:tldr:5c99f useradd: Create a new user with the home directory filled by template directory files.$ sudo useradd --skel ${path-to-template_directory} --create-home ${username}try on your machineexplain this command
-
useradd:tldr:5db97 useradd: Create a new user with the specified shell.$ sudo useradd --shell ${path-to-shell} ${username}try on your machineexplain this command
-
useradd:tldr:6f755 useradd: Create a new system user without the home directory.$ sudo useradd --system ${username}try on your machineexplain this command
-
useradd:tldr:7d55d useradd: Create a new user.$ sudo useradd ${username}try on your machineexplain this command
-
useradd:tldr:90d53 useradd: Create a new user with the default home directory.$ sudo useradd --create-home ${username}try on your machineexplain this command
-
useradd:tldr:f7ef3 useradd: Create a new user belonging to additional groups (mind the lack of whitespace).$ sudo useradd --groups ${group1,group2,---} ${username}try on your machineexplain this command