8

How do I create a new user account on Ubuntu?

1

2 Answers 2

12

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.

5
  • This is the simpler answer since this question does not specify GUI vs CLI.
    – muad-dweeb
    Aug 27, 2021 at 16:02
  • 2
    Use sudo passwd <username> afterwards to set the password. Aug 16, 2022 at 8:58
  • Could use some explanation of the -g users and -m options.
    – NeilG
    May 21, 2023 at 7: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, 2023 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, 2023 at 1: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

1
  • 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, 2023 at 6:58

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .