Ubuntu 20.04 LTS – Create User

Ubuntu lets you create additional user accounts for people who share the same computer or for separate administrative and service tasks. On Ubuntu 20.04 LTS, you can create a user from the desktop Settings application or from the command line.

This tutorial first keeps the original graphical procedure for Ubuntu 20.04, then shows the commonly used adduser and useradd commands, how to create a password, add a user to the sudo group, add a user to another group, verify the account, and remove a user when it is no longer needed.

The screenshots in the graphical procedure were taken on a PC running Ubuntu 20.04 with Linux kernel version 5.4.0-33-generic. Minor labels can differ after package or desktop updates.

Create a User in Ubuntu 20.04 from Settings

Use the following steps when you want to create the account through the Ubuntu desktop interface.

  1. Start your Ubuntu PC and open Applications. Then click on Settings.
    Ubuntu Create User

  2. Scroll the left menu and find Users. Click on the Users tab. You will see the existing users as shown below.Ubuntu Create User
  3. Unlock to Change Settings. On the top of the Users, you would see a dialog with Unlock button. Click on the Unlock button. A prompt appears to enter password.Ubuntu Create User
    Enter password of the user, which you currently logged in.Ubuntu Create User
  4. Now you would see an Add User button, in green background, as shown below.Ubuntu Create User
    Ubuntu Create User
  5. Click on Add User button. A form like window appears to Add User as shown below.Ubuntu Create User
    Account Type – There are two types. First one is Standard where user does not have admin privileges. Second one is Administrator and the name explains it all. Choose an Account Type based on your required assignment of privileges to the new user. We will select Standard for this tutorial.

    Full Name – Enter full name of the user. Like First Name followed by Last Name.

    Username – When you enter your Full Name, Username is populated as shown in the following screenshot. But you may change this Username. This Username appears in the command prompt and user folder and files.

    Ubuntu Create User


    Then comes the Password. You can allow the user to set a password when they first login. Or, you can set a password and share with them.

    There are some rules that you have to follow for a password. You should not use common words, or user name. And there should be alphabets, numbers, special symbols, a long password, etc. Set a Password and repeat it in Confirm Password.

    Ubuntu Create User
    Ubuntu Create User



    Now click on the Add button present at the top right corner of the Add User window. It might take few seconds to set up the user directory and some files.

    Ubuntu Create User

  6. After you click on the Add button, you will see that a new user is created with the details you provided.Ubuntu Create User
    You can also change some of the properties like Account Settings and Authenticate & Login using switch buttons. as shown below.

    Ubuntu Create User

For additional guidance on the graphical method, Ubuntu provides a reference page for adding a new user account.

Create a User in Ubuntu 20.04 from the Command Line with adduser

On Ubuntu, adduser is a convenient command for creating a normal interactive user. It creates the account, prepares the user’s home directory, copies default files, and prompts you to set a password and optional account information.

For example, to create a user named alex, open Terminal and run:

</>
Copy
sudo adduser alex

Ubuntu prompts you for your current administrator password if required, then asks for the new user’s password. It can also ask for fields such as full name and phone numbers. Those optional fields can be skipped by pressing Enter.

After the command completes, the new account normally has a home directory at /home/alex. The user can sign in with the username and password you created.

Create an Ubuntu 20.04 User with a Home Directory Using useradd

Ubuntu also includes the lower-level useradd command. Unlike the interactive adduser command, useradd is commonly used with options that explicitly define how the account should be created.

To create the user alex and create a home directory for that account, use the -m option:

</>
Copy
sudo useradd -m alex

Then set the user’s password separately:

</>
Copy
sudo passwd alex

The passwd command asks you to enter the new password twice. The password itself is not displayed while you type it.

If the account should use Bash as its login shell, you can specify the shell while creating it:

</>
Copy
sudo useradd -m -s /bin/bash alex
sudo passwd alex

Create an Ubuntu User and Add It to the sudo Group

A newly created standard user does not automatically receive administrative privileges. On Ubuntu 20.04, users who are allowed to perform administrative tasks with sudo are normally members of the sudo group.

After creating alex, add that account to the sudo group with:

</>
Copy
sudo usermod -aG sudo alex

The -aG options append the user to the supplementary group without replacing the user’s existing supplementary group memberships. The user should sign out and sign back in before relying on the new group membership in a desktop session.

To verify the groups assigned to the account, run:

</>
Copy
groups alex

If sudo appears in the output, the account is a member of that group.

Add an Ubuntu 20.04 User to Another Group

You can use the same usermod -aG pattern to add a user to another existing group. For example, if a group named developers already exists:

</>
Copy
sudo usermod -aG developers alex

You can check the result with:

</>
Copy
groups alex

Do not omit -a when you intend to keep the user’s existing supplementary groups. Using usermod -G by itself sets the supplementary group list and can remove memberships that were not included in the command.

Verify That the New Ubuntu User Exists

The id command is a direct way to confirm that Ubuntu knows about the new account and to inspect its numeric user ID, primary group, and supplementary groups:

</>
Copy
id alex

You can also check the account entry with getent:

</>
Copy
getent passwd alex

If an entry is returned, the account is available through the system’s configured user database. For a locally created account, the line normally includes the username, user ID, primary group ID, home directory, and login shell.

Create an Ubuntu 20.04 User Without Setting a Password

Sometimes an administrator needs an account that should not initially authenticate with a local password. With adduser, you can create such an account using --disabled-password:

</>
Copy
sudo adduser --disabled-password alex

This creates the user without enabling password authentication for that account. It is not the same as assigning an empty password. If the account later needs a local password, set one explicitly with sudo passwd alex.

Delete a User in Ubuntu 20.04

If the account is no longer needed, you can remove it with deluser. To remove the account while leaving its home directory and files in place, run:

</>
Copy
sudo deluser alex

To remove the account and its home directory, use:

</>
Copy
sudo deluser --remove-home alex

Review the files that belong to the user before deleting a home directory. Removing an account can affect scheduled jobs, application permissions, shared files, or services that were configured to run under that username.

Ubuntu 20.04 adduser and useradd Difference

Both commands can create local accounts, but they are used differently. adduser is an Ubuntu/Debian-friendly wrapper that provides an interactive account-creation workflow and sensible defaults. useradd is a lower-level utility that is useful when you want to specify account properties explicitly or use the command in controlled administrative workflows.

  • adduser: convenient for creating a normal interactive Ubuntu user and setting its password in one guided process.
  • useradd: useful when you want to explicitly specify options such as home-directory creation and login shell.
  • passwd: sets or changes the user’s local password.
  • usermod -aG: appends the account to supplementary groups such as sudo.
  • deluser: removes a local account, with an option to remove its home directory as well.

Ubuntu 20.04 User Creation Editorial QA Checklist

  • Confirm that the graphical instructions still refer specifically to the Ubuntu 20.04 Users settings shown in the existing screenshots.
  • Verify that sudo adduser username is presented as the guided Ubuntu account-creation method.
  • Check that every useradd example that is intended to create a home directory includes the -m option.
  • Verify that password creation uses passwd and does not place a plaintext password directly in a shell command.
  • Confirm that administrator access is explained through membership in the Ubuntu sudo group rather than by editing sudoers unnecessarily.
  • Check that usermod -aG is used when adding a user to a supplementary group so existing supplementary memberships are preserved.
  • Make sure the passwordless-account section distinguishes a disabled password from an empty password.
  • Confirm that the deletion section clearly distinguishes removing only the account from removing the account together with its home directory.

Ubuntu 20.04 User Creation Summary

In this Ubuntu Tutorial, we learned how to create a new user in Ubuntu 20.04 LTS from Settings and from the command line. For a normal interactive account, sudo adduser username is the straightforward command-line method. We also covered creating a home directory with useradd -m, setting a password, adding a user to the sudo or another group, verifying the account, creating an account with password authentication disabled, and deleting a user.