Ubuntu – When to use adduser or useradd

addusercommand lineuseradd

The Question consist of three parts

  1. What are the differences between them
  2. When to use adduser or useradd
  3. and why there is more than one command for the same purpose

Best Answer

  1. There is no difference in the functions provided, just that useradd is a compiled binary, and adduser is a perl script. adduser is more user-friendly, so it could fit better for a beginner.

  2. Use adduser create a fully functional user on the system. The command will run tasks like creating home directory, creating a group for it, promting for password, etc. Beside that useradd will just create the user (ofcourse you can use switches, but the default is just the user creation).

  3. The two commands are not identical (adduser runs useradd and many other things).

Related Question