Forrest logo
back to the useradd tool

useradd:tldr:7d55d

useradd: Create a new user.
$ sudo useradd ${username}
try on your machine

The command "sudo useradd ${username}" is used to create a new user account on a Linux or Unix-like system with administrative privileges.

Here's a breakdown of the command:

  • "sudo": It is used to execute a command with root privileges. By using "sudo" before the command, the user is prompted to enter their password to authenticate themselves and gain administrative access.
  • "useradd": It is a command-line utility used to create a new user account on the system.
  • "${username}": It is a placeholder for the actual username that you want to create. You need to replace "${username}" with a specific username of your choice, without the "$" symbol. For example, if you want to create a user named "john", the command would be: "sudo useradd john".

When the command is executed, a new user account is created on the system with the specified username. However, the user account does not have a password, home directory, or any group association. Additional options could be added to the command to specify those attributes, like "sudo useradd -m -s /bin/bash ${username}", where "-m" creates a home directory and "-s /bin/bash" sets the default shell to Bash.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the useradd tool