How to Create a New User on Ubuntu 22.04

Wondering how to create a new user on Ubuntu 22.04? Don’t worry, we got you covered!

Linux distributions have come a long way since their creation in 1991. Used in many IT fields, such as networking, embedded systems, and robotics, Linux has cemented itself as a superior platform compared to its competitors.

Not only that, improvements in the graphical user interface (GUI) have led to Linux distributions becoming a part of the lives of many individuals. One of the best user-friendly Linux distributions is Ubuntu, known to be fast, free, and secure.

Suppose you plan to use Ubuntu on a system that witnesses multiple users daily. In that case, we recommend adding more users as that’ll make separate directories for your important files and ensure that you won’t accidentally alter the files of others.

This guide will teach you how to create a new user on Ubuntu 22.04. We’ll go over different methods to create a new user in Ubuntu, along with some additional information.

With that being said, let’s begin!


Requirements for Creating a User.

Before you can learn how to create a new user on Ubuntu 22.04, you’ll need to ensure that all the requirements are met, so you don’t encounter any errors.

Firstly, make sure that you’re running Ubuntu 22.04 on your system. While this guide can also be used for other Linux distributions, the command syntax may not be the same.

Furthermore, to create a user, you’ll need an account with sudo or root privileges. If you’re the main user, then these privileges will be available on your account by default. If not, then contact the administrator to allow you root access.

Once you’ve ensured that you meet the requirements, you’re ready to go to the next step.


Method 1: Create a User Using the $adduser.

The first method you’ll learn will be utilizing the Command Terminal to create a new user.

This method will make use of the $adduser command. As the name suggests, it adds a user to the system. This user is created with the necessary directories, paths, and groups.

Follow these steps to add a user in Ubuntu:

  1. Start by opening the Command Terminal by pressing Ctrl + Alt + T on your keyboard.
  2. Once that’s done, type the following:
$ sudo adduser <name of user>

For example,

$ sudo adduser UbuntuUser
Create a New User on Ubuntu 22.04
  1. Set a password for the newly created user
  2. Lastly, enter the necessary details about the user. You can leave this section blank as well.

If you followed the steps correctly, you should have successfully created a new user on your system.


Method 2: Create a User Using the $useradd.

If you’re only looking to create a user to test something out, then you can use the $useradd command.

The $useradd command works by creating a new user without creating any additional content like directories, passwords, paths, etc. This is perfect if you’re only creating a user to test out commands.

Follow these steps to create a new user using $useradd:

  1. First, open the Command Terminal by pressing Ctrl + Alt + T on your keyboard.
  2. Once that’s done, proceed to type the following to create a new user:
$ sudo useradd <name of user>

For Example,

$ sudo useradd UbunUser
Create a New User on Ubuntu 22.04

Unlike the previous method, you won’t be prompted to input additional information.

If you followed the steps correctly, you should now have created a new user on your system. If the CLI methods seem difficult to understand, then don’t worry, as there are GUI methods to do the same.


Method 3: Create a User Using the GUI.

If the previous methods didn’t work out for you, you can always opt for the GUI method.

Although it involves more steps, it is simpler to understand. This method will make use of Ubuntu’s “Settings” application.

While this method is for Ubuntu 22.04, you can use it with the previous versions of Ubuntu as well.

Follow these steps to create a new user using the GUI:

  1. First, Start by navigating to your desktop. Click on the “Show Applications“ icon in the bottom-left corner of your screen. It is highlighted in yellow.
Create a New User on Ubuntu 22.04
  1. Once that’s done, proceed to type “Settings” in the search bar and click on the first result.
Create a New User on Ubuntu 22.04
  1. Next, go to the Users tab.
ubuntu
  1. Once you’re there, click on the button titled “Unlock”. This should be located in the top-right corner of the window.
  2. Complete the authentication by typing your account password. Make sure that your account has sudo or root privileges. You should now see an “Add User” button in the top right corner.
new user
  1. Click on that button to add a new user. A new window will open, asking for details about the new user. Enter them as per need, and click on “Add”.
  2. Lastly, enter your account’s password once more to finish the creation process.

If you followed the steps correctly, you successfully learned how to create a new user on Ubuntu 22.04.


Removing Users.

Aside from adding users, you also have the option to remove them from your system.

This process is also fairly simple and can be done using the $deluser command.

Follow these steps to delete users from Ubuntu 22.04:

  1. Start with opening the Command Terminal by pressing Ctrl + Alt + T on your keyboard.
  2. Once that’s done, type the following:
$ sudo deluser <name of user>

For example,

$ sudo deluser UbuntuUser
  1. If you wish to delete everything related to the user, including their respective home directories, use the following command:
$ sudo deluser --remove--home <name of user>

If you have followed the steps correctly, then congratulations, you’ve successfully removed users from your system.

While this guide was meant for Ubuntu 22.04, we have a similar guide that tackles the problem of adding or removing users on Ubuntu 20.04 LTS, so be sure to check that out if you’re using Ubuntu 20.04 LTS.

We hope this guide helped you learn how to create a new user on Ubuntu 22.04. If you have any questions, comments, or suggestions, let us know in the comment section down below.

If you liked this article, please share it. 🙂

Author

Leave a Reply

Your email address will not be published. Required fields are marked *