A user is a person who has full rights to use something. The Linux user can access the Linux system, manipulate files, and perform many other system tasks. By creating a new user, we can grant access to someone to use the system. Ubuntu 22.04 allows you to add and remove users via terminal and GUI.
In this post, we will elaborate on the methods to add or remove users on Ubuntu 22.04:
- using Terminal
- using GUI
Let’s get started!
Method 1: Add users using Terminal on Ubuntu 22.04
Follow the below-provided procedure to add a new user on Ubuntu 22.04 using the terminal.
Step 1: Add new user
Press “CTRL+ALT+T” to open the Ubuntu 22.04 terminal and add a new user using the provided command. For instance, we have specified “newuser” as the user’s name:
$ sudo adduser newuser
After executing the given command, you will be prompted to enter a new “password”. Enter a secure password, your full name, and other required information, and click “Y” for the verification:
Step 2: Add user to sudo group
Add the newly created user to the “sudo” group:
$ sudo usermod -aG sudo newuser
Step 3: Confirm assigned group
Lastly, confirm the assigned group of the user with the help of the following command:
$ groups newuser
From the below-given output, it is clear that “newuser” is added in the “sudo” group:
Let’s move ahead to add a user using the GUI method.
Method 2: Add users using GUI on Ubuntu 22.04
For adding a new user on Ubuntu 22.04 using the GUI, follow the below listed instructions.
Step 1: Open System Settings
In the “Activities” menu, search for “Settings” and open it:
Step 2: Open Users menu
Navigate to the “Users” menu and click on the “Unlock” button to create a new user:
The “Authentication Required” wizard will be shown on the screen. Specify the system password and press the “Authenticate” button:
Step 3: Create new user
In the next step, click “Add User” to create a new user on Ubuntu 22.04:
Provide the required information such as “Full Name” and “Username”. Then, click on the “Set a password now” radio button and enter “Password”:
Lastly, click on the “Add” button to add a new user on Ubuntu 22.04:
It is evident from the below image that we have successfully created a new user on Ubuntu 22.04:
Let’s check out the method to remove users from Ubuntu 22.04.
Method 1: Remove users using Terminal on Ubuntu 22.04
To delete a user from Ubuntu 22.04, utilize the given command:
$ sudo deluser newuser
Method 2: Remove users using GUI on Ubuntu 22.04
To remove users from Ubuntu 22.04, follow up on the below-given details.
First, go to the “Users” menu from the system settings and click on the “Unlock” button:
Provide the system password in the “Authentication Required” dialog box, then hit the “Authenticate” button:
Select the user you want to remove:
Scroll down and click on the “Remove User” button to delete the user from Ubuntu 22.04:
To remove the user and its home directory, click the “Delete Files” button:
As you can see, we have successfully removed a user from Ubuntu 22.04 using GUI:
We have effectively explained the possible methods to add or remove a user on Ubuntu 22.04.
Conclusion
To add new or remove users on Ubuntu 22.04, either use the GUI method or terminal. In the first approach, to add a new user, run the “sudo adduser newuser” command and add the created user to the “sudo” group. In the GUI method, open System Settings and navigate the “Users” menu to add or remove a user. With the help of the terminal and GUI, we demonstrated how to add or remove users from Ubuntu 22.04.
TUTORIALS ON LINUX, PROGRAMMING & TECHNOLOGY