6

How do I create a new user account on Ubuntu?

Zanna
  • 69,223
  • 56
  • 216
  • 327
Sarah Robertson
  • 69
  • 1
  • 1
  • 3

2 Answers2

9

useradd -m -g users <username> will create the user and add them to the "users" group.

  • -m adds a user directory (i.e., /home/<username>).
  • -g adds that user to a specified group. This is optional.

Look into the useradd reference for more info on using the command.

Brennan
  • 103
  • 4
aborsim
  • 91
  • 1
  • This is the simpler answer since this question does not specify GUI vs CLI. – muad-dweeb Aug 27 '21 at 16:02
  • 1
    Use `sudo passwd ` afterwards to set the password. – stackprotector Aug 16 '22 at 08:58
  • Could use some explanation of the `-g users` and -m options. – NeilG May 21 '23 at 07:14
  • @NeilG Look at the manpage that was linked in the answer. There are descriptions that explain what those options do. IMO, you don't need the `-g users`, unless you want an easy way to tell which users are "users" and which are used for other purposes like service users. – Brennan Aug 16 '23 at 13:18
  • 1
    @Brennan, I'm familiar with the `man` page (although I keep forgetting the details since I only use it rarely and have to look it up every time). I just tried to indicate stack exchange practice usually prefers answers to contain the required content, rather than just linking to somewhere else. This also helps the OP (and the rest of us) in quickly providing focused instructions that are precisely targeted to the OPs question. Sometimes this helps understanding and confidence. But either way, it's preferred to answer the question here on the site, rather than just linking. – NeilG Aug 17 '23 at 01:20
2

Follow these steps to create a new user in Ubuntu :

  1. Open Terminal by pressing Crtl+Alt+T or Search 'Terminal' in Dash.
  2. Execute the following command in terminal

    sudo apt-get install gnome-system-tools

  3. Search "Users" in Dash

enter image description here

  1. Click and it will run the Users and Groups :

enter image description here

  1. Click Add Button to add new user

enter image description here

Faizan Akram Dar
  • 4,441
  • 1
  • 22
  • 31
  • Compare command line option with GUI option and just decide to stop using GUI systems where a quicker, simpler and more powerful command line is available ... – NeilG May 21 '23 at 06:58