Forrest logo
back to the useradd tool

useradd:tldr:5db97

useradd: Create a new user with the specified shell.
$ sudo useradd --shell ${path-to-shell} ${username}
try on your machine

The given command is used to create a new user in a Linux system with the specified shell and username.

  • sudo: This keyword is used to run the command with administrative privileges. It allows the user to perform actions as a superuser or another user.
  • useradd: The useradd command is used to create a new user account in the system.
  • --shell ${path-to-shell}: This option specifies the login shell for the new user. ${path-to-shell} needs to be replaced with the actual path of the desired shell. For example, /bin/bash is a commonly used shell.
  • ${username}: This parameter specifies the username for the new user. It can be set to the desired username.

When this command is executed with the appropriate values, it creates a new user account in the system, and assigns the specified shell to that user for accessing the system.

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