How to Add Users in Ubuntu 22.04?

How to Add Users in Ubuntu 22.04

Empowering your Ubuntu system with additional user accounts is a fundamental skill for effective system administration. In this guide, we’ll walk you through the straightforward process of adding a user to your Ubuntu environment. Whether you’re looking to grant access to a new team member or simply enhance user management, mastering the ‘adduser’ command and understanding user permissions will ensure a seamless and secure experience. Join us as we break down the steps to expand user access on your Ubuntu system, providing you with the knowledge to manage users effortlessly.

Method 1: Add users in Ubuntu through GUI

If you are a Ubuntu desktop user, you can add users to your system through the system settings utility. You can access by clicking on the battery/network icon in the upper right corner, and then select “settings”.

From the left pane, scroll down, till you see the “Users” option. Click on it.

On the right pane, you will see some option disabled. You will need to click on the unblock button and authenticate the process with your admin credentials.

After this is authenticated, you need to click on the “Add User” button, next to the minimize button.

You will see the following dialog box appear. Now select the type of privileges you would want your new account to have, like “Standard” or “Administrator”. Then enter the name and your username will be filled automatically.

Following that, you have the option to either let the user set their account password during their next login or set a password immediately by selecting the “Set a password now” radio button and entering the password twice. After completing these configurations, click the “Add” button in the upper right corner to successfully create the user.

Removing the user through GUI

To remove a user using the GUI, start-up the Settings utility like you did when adding the user from the upper right corner of your screen and selecting Settings. Navigate to the Users tab within the Settings utility from the left panel. Subsequently, click on the Unlock button, similar to the last step, to modify settings. Following this, input your password for authentication and then click on the Authenticate button.

When it unlocks, you’ll now be able to modify the user settings, and remove any desired user.

Now select the user you want to remove and click on the red “Remove User” button at the bottom of the panel at the right.

Once you click on the button, you’ll be given the option to retain or delete the user account files, including the user’s “Home” directory. If you wish to keep them, simply click on “Keep Files”; otherwise, select “Delete Files” to remove the user along with its “Home” directory.

Once you select the option, the user will be removed. Now we will take a look at how you can achieve this through the terminal.

Method 2: Add users in Ubuntu through the terminal

Adding a user through the terminal is pretty straight-forward. You can just fire up your terminal and run the following:
$sudo adduser [username]

Here you need to replace [username] with your desired username for the new account. As you execute the command, you will need to enter your sudo password. In some cases, you might need to confirm it again. After that, you will be prompted to enter more details for the new user account, or you can just press return to select the default values.

After entering all the details, the terminal will display all of the entered details against all of the fields and you can make changes if you need to make any.

Remove the user through terminal

Now if you want to remove the user account and delete the related files and settings, you’ll need to run the following commands:
$sudo deluser [username]
This will remove the user account from the computer. Now if you want to remove the user account as well as the content of their home directory, you can use the “–remove-home” option before the username like such:
$sudo deluser –remove-home [username]

This will free the consumed disk space as well.

Conclusion

In conclusion, mastering the paths to adding users in Ubuntu is a fundamental skill for any Linux enthusiast or administrator. This article has provided a comprehensive guide, highlighting the methods available, from command-line utility to user-friendly GUI. Whether you’re a beginner navigating the Linux landscape or a seasoned user seeking a quick refresher, understanding the intricacies of user management in Ubuntu is essential for a smooth and secure system administration experience. Equipped with this information, users can now  Empowered with this knowledge, users can confidently navigate user accounts, permissions, and groups, ensuring a robust and tailored Ubuntu environment that meets both individual and organizational needs