- 1How to Add a New User in Linux
- 2Modify Existing User in Linux
- 3Delete a User in Linux — Step-by-Step for Beginners
- 4Create a User Group in Linux - Step-by-Step Tutorial
- 5Linux: Add User to Group
- 6How to Remove a User from a Group in Linux
- 7Delete a User Group in Linux - Beginner Friendly Tutorial
- 8Linux su Command Tutorial – Switch Users Easily
- 9Linux sudo Command - Execute as Another User
- 10Change a User's Password in Linux Using passwd
- 11Set Password Expiry in Linux using chage
- 12Lock a User Account in Linux
- 13How to Unlock a User Account in Linux
- 14Configure User Login Shell in Linux
- 15How to Configure User Environment Variables in Linux
- 16Edit .bashrc and .profile in Linux - User Startup Files Tutorial

- 1Linux Topics Index
- 2How to Create a File in Linux
- 3How to Rename a File in Linux
- 4How to Copy a File in Linux
- 5How to Move a File in Linux
- 6How to Delete a File in Linux
- 7How to Create a Directory in Linux
- 8How to Delete a Directory in Linux
- 9How to Copy Directories Recursively in Linux
- 10Delete Directories Recursively in Linux
- 11How to View Hidden Files in Linux
- 12How to Create a Hidden File in Linux
- 13How to Create a Hidden Directory in Linux
- 14How to Find Files in Linux Using find Command
- 15Find Files in Linux Using locate Command
- 16How to View File Contents Using cat in Linux
- 17How to View File Contents Using less in Linux
- 18View File Contents Using the more Command in Linux
- 19Compare Files Using diff Command in Linux
- 20Compare Files in Linux Using cmp Command
- 21Check File Type in Linux with file Command
- 22Create Symbolic Links with ln -s in Linux
- 23How to Archive Files Using tar Command in Linux
- 24Compress Files with gzip in Linux – Beginner Tutorial
- 25How to Compress Files Using bzip2 in Linux
- 26Compress Files in Linux Using zip Command
- 27Extract Compressed Files using tar in Linux
- 28Extract ZIP Files on Linux with unzip
- 29How to Extract .gz Files using gunzip in Linux

- 1How to Add a New User in Linux
- 2Modify Existing User in Linux
- 3Delete a User in Linux — Step-by-Step for Beginners
- 4Create a User Group in Linux - Step-by-Step Tutorial
- 5Linux: Add User to Group
- 6How to Remove a User from a Group in Linux
- 7Delete a User Group in Linux - Beginner Friendly Tutorial
- 8Linux su Command Tutorial – Switch Users Easily
- 9Linux sudo Command - Execute as Another User
- 10Change a User's Password in Linux Using passwd
- 11Set Password Expiry in Linux using chage
- 12Lock a User Account in Linux
- 13How to Unlock a User Account in Linux
- 14Configure User Login Shell in Linux
- 15How to Configure User Environment Variables in Linux
- 16Edit .bashrc and .profile in Linux - User Startup Files Tutorial
How to Add a New User in Linux
Next Topic ⮕Modify Existing User in Linux
How to Add a New User in Linux
In this Linux tutorial, we shall see how to add a new user to your system. If you're setting up a Linux machine for multiple users, or just want to create a new account for practice or development, this guide will walk you through it step by step.
Step 1: Open the Terminal
First things first, open your terminal. If you're on a server, make sure you're logged in as a user with sudo privileges.
Step 2: Use the useradd
Command
To create a new user, we'll use the useradd
command followed by the username you want to assign. For example, let's create a user named john
:
sudo useradd john
But wait! This just creates the user—it doesn’t set a password or create a home directory. So let’s do that properly using options.
Step 3: Create User with Home Directory
Use the -m
option to create the home directory automatically:
sudo useradd -m john
Step 4: Set a Password for the User
Now let’s give our new user a password. This is done using the passwd
command:
sudo passwd john
You’ll be prompted to enter and confirm the new password:
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully
Step 5: Verify the User
To verify that the user was added successfully, you can check the list of users using:
cat /etc/passwd | grep john
john:x:1001:1001::/home/john:/bin/bash
This shows that the user john
exists and has a home directory at /home/john
.
Step 6: Optional – Add User to Sudoers Group
If you want your new user to have sudo (admin) privileges, add them to the sudo
group:
sudo usermod -aG sudo john
Now john
can use sudo
to run admin commands.
And You're Done!
That’s it! 🎉 You’ve successfully added a new user to your Linux system. This is a foundational skill for Linux system administration. Practice this a few times, and you’ll be managing users like a pro.