How to Create a New User Account in Ubuntu Linux via Terminal

When configuring a Linux server or setting up a shared workstation, creating separate user accounts is a fundamental security practice. Instead of sharing a single login or granting everyone root access, giving each person their own account ensures that personal files remain private and system configurations cannot be accidentally broken.

While desktop versions of Ubuntu include a graphical settings menu for managing users, knowing how to create an account via the terminal is essential. It is much faster, works on headless servers, and gives you far more control over the account creation process.

In this guide, we will show you the professional workflow for creating a new user account in Ubuntu, setting their password, and granting them administrative privileges if necessary.

Step 1: Open Your Terminal

If you are using a desktop version of Ubuntu, press Ctrl + Alt + T on your keyboard to launch the terminal window. If you are connecting to a remote server, log in via SSH using your current administrator credentials.

Note: To create a new user, your current account must have “sudo” (superuser) privileges.

Step 2: Use the ‘adduser’ Command

Linux actually has two commands for creating users: useradd and adduser. You should almost always use adduser. It is a much friendlier, interactive script that automatically creates the user’s home directory and sets up the correct shell environments for you.

To create a new user (let’s call the user “johndoe”), type the following command and press Enter:

sudo adduser johndoe

The terminal will prompt you to enter your own current password to verify your administrative access. Note that as you type your password, nothing will appear on the screen—this is a normal Linux security feature. Press Enter when finished.

Step 3: Complete the Interactive Setup

Once you authenticate, the adduser script will take over and guide you through a series of prompts.

  1. New password: You will be asked to create a secure password for the new user. Type it out and press Enter, then type it again to confirm.
  2. Full Name: Enter the user’s real name (e.g., John Doe).
  3. Room Number, Work Phone, etc.: The script will ask for several pieces of contact information. In most modern setups, this is completely unnecessary. Simply press Enter to leave these fields blank and skip past them.
  4. Is the information correct? [Y/n]: Type Y and press Enter to finalise the account creation.

Congratulations, the new user account has been successfully created! The user can now log into the machine using their username and the password you just set.

Step 4: Grant Administrative Privileges (Optional)

By default, the new user you just created is a “standard” user. They can browse the web, create documents, and modify their own files in their home directory, but they cannot install software or change core system settings.

If this person is a trusted colleague who needs the ability to run administrative commands, you must add them to the sudo group.

To grant the new user sudo privileges, type the following command and press Enter:

sudo usermod -aG sudo johndoe

Let’s break down what this command does:

  • usermod: The tool used to modify existing user accounts.
  • -aG: Stands for “append to Group”. It ensures the user is added to the new group without being removed from any of their existing groups.
  • sudo: The name of the administrative group in Ubuntu.

Step 5: Verify the User Creation

If you want to quickly double-check that the user was created correctly and belongs to the right groups, you can use the id command.

Type the following and press Enter:

id johndoe

The terminal will output the user’s ID numbers and list all the groups they belong to. If you granted them administrative rights in the previous step, you should see sudo listed in the output.

By following these simple steps, you can confidently manage user access across any Ubuntu machine, maintaining a secure and professional Linux environment.

Leave a Reply

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

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.

Receive our best articles and tips delivered straight to your inbox.