How to Manage Users on Ubuntu: Create, Customize, and Delete Accounts Using adduser

1. Introduction

Ubuntu is a Linux-based open-source operating system widely used for everything from personal computing to cloud server management. Among various system management tasks, user management is one of the most fundamental and important responsibilities.
In this article, we will explain how to add new users using the adduser command, how to delete users, and how to grant administrator privileges in Ubuntu. This guide is tailored for beginners and intermediate users, providing clear step-by-step instructions—even for those unfamiliar with command-line operations.

2. What Is User Management in Ubuntu?

User management in Ubuntu refers to the process of adding multiple users to the system and assigning proper permissions to each of them. To maintain system security and efficiency, it is crucial to configure access rights individually for every user.

In particular, administrators (users with sudo privileges) can securely maintain the entire system by managing other users appropriately. Here, we introduce a simple and effective user management method using the adduser command.

3. Basics of the adduser Command

The adduser command is a high-level interface used in Ubuntu to create new users. Unlike the useradd command, adduser is more user-friendly and suitable for beginners.

For example, to create a new user named “testuser”, run the following command:

sudo adduser testuser

This command creates the user “testuser” and automatically generates a home directory. You will then be prompted to set a password and optionally provide additional information such as a full name.

4. Steps to Add a New User Using adduser

  1. Open the terminal (Ctrl + Alt + T).
  2. Enter the following command:
   sudo adduser username

Replace “username” with the desired username.

  1. You will be prompted to set a password. Enter a strong password and confirm it.
  2. You may input additional information such as full name or phone number, but these are optional.
  3. Once you confirm the details, the new user will be created.

From a security perspective, always set a strong password. Avoid short or simple passwords, and include a combination of letters, numbers, and symbols.

5. Customizing User Creation with adduser

The adduser command provides several options to customize user creation. Here are some useful options:

  • -d: Specify a custom home directory.
  sudo adduser -d /custom/home username
  • -s: Specify the login shell.
  sudo adduser -s /bin/zsh username
  • -G: Add the user to additional groups.
  sudo adduser -G sudo username

By combining these options, you can flexibly customize user settings based on system requirements.

6. Managing Users via GUI

Even users unfamiliar with the command line can easily manage users through Ubuntu’s GUI interface.

  1. Open the “Settings” menu and select the “Users” tab.
  2. Click “Unlock” and enter your administrator password.
  3. Click “Add User” and enter the required information.

The GUI provides an intuitive experience, making it a great option for those uncomfortable with terminal commands.

7. Assigning Administrator Privileges to a New User

Users with administrator privileges can execute system-wide operations using the sudo command. To give a new user administrative rights, run:

sudo usermod -aG sudo username

This command adds the user to the sudo group, enabling system administrator capabilities. Important note: only grant administrative privileges to trusted users.

8. Deleting Users with deluser

If a user is no longer needed, the deluser command allows you to remove them easily.

Basic deletion:

sudo deluser username

To delete the user along with their home directory:

sudo deluser --remove-home username

Before deleting a user, always back up important data, as recovery may not be possible afterward.

9. Common Issues and Troubleshooting

Handling error messages:

  • If a “permission denied” error appears, the user may lack sudo rights. Ask an administrator for access or add the user to the sudo group.
  • If you see a “user already exists” error when running adduser, choose a different username.

To verify whether the user has been created correctly, use:

grep username /etc/passwd

10. Summary

User management in Ubuntu is essential for maintaining both system security and operational efficiency. With the adduser command, you can easily create users, customize profiles, and assign administrator privileges. Ubuntu also offers GUI tools, making the process accessible even for beginners.

By following this guide, you will be able to manage Ubuntu users effectively and operate your system more securely and efficiently.