How to add users in Linux

An image of someone typing on a white wireless mechanical keyboard
(Image credit: Shutterstock)

Wondering how to add users in Linux? There can be all kinds of reasons why you might need to add a new user to a Linux system. If you've got one of the best computers around, it makes sense that your family members might want to use it too. 

The advantages of multiple user accounts include bolstering security, optimizing resource usage, and fostering collaboration. You can also improve safety by assigning specific permissions to users, minimizing the risks associated with widespread superuser access. 

Collaboratively, multiple users can operate simultaneously in a multi-user environment, sharing resources without interference. Practical examples include creating an administrative user for system tasks, establishing individual developer accounts for project work, and setting up users for file sharing or team-specific accounts. 

As with other operating systems like Windows 11 and macOS, adding new users in Linux is commonplace and easy. This how-to guide walks you through the basic first steps of setting up a new user in Linux.

How to add users in Linux

Note: Only administrative users can set up new user accounts, so you'll need to make sure you have sufficient access permissions on your system in order to carry out the steps below.

1. Open Command Line and enter "sudo useradd [username]"

(Image: © Future)

To set up a new user in Linux, you will need to use the sudo command.

In Linux and other Unix-like operating systems, sudo stands for superuser do. It is a command-line utility that allows permitted users to execute a command as the superuser. Using "sudo" is a way to perform administrative tasks without logging in as the root user. (The root user has unrestricted access to all commands and files on a system, which can be potentially dangerous.)

Press Ctrl-Alt-T to open up your Linux command line interface. Now enter the sudo command in the following format: sudo useradd <username>

As you can see in the screenshot above, I ran the command sudo useradd David. I then needed to enter my password before the new user was added. You may not need to enter a password; it depends on how your system is configured.



2. Set a password for new user

(Image: © Future)

For a user to have a workable login, they need a password. Enter sudo passwd [username]

I set up the new user's password with the command sudo passwd David.

You'll need to enter the password twice for security purposes. Once this has been done, Linux returns the message password updated successfully.

3. Check new user has been added by listing users

(Image: © Future)

You can check that your new user has been added to the user list by entering the command cat /etc/passwd.

This produces a list of all users. It includes both applications and human users. The new user, David, now appears at the bottom of the list.

4. Set up a new user with a directory

(Image: © Future)

It is also possible to create a new user and a user directory at the same time simply by adding -m to your useradd command.

In the example above, I ran the command sudo useradd -m Ncuti. This means that a user directory inside the home directory has been created for Ncuti. 

5. Check home directory for new user

(Image: © Future)

You can check the directory has been created by navigating to the home directory and typing ls.

In the example above, there are now two user directories in home. An existing directory called emma and a new one named Ncuti.


Once you have users set up in Linux, you can add details using the command usermod. Modifications might include adding the user's full name, changing their login shell, or adding them to groups. As with the useradd command, you'll need to have administrative permissions to make these changes.

Linux commands are incredibly versatile. This flexibility makes Linux a powerful tool when it comes to creating, modifying, and managing multiple user accounts.

Why not increase your Linux knowledge even further with our range of tutorials. We can show you how to rename a file in Linux, how to remove a directory in Linux and how to find a file in Linux.

Emma Street
Contributor

Emma Street is a freelance content writer who contributes technology and finance articles to a range of websites, including Tom's Guide, Top10.com, and BestMoney. She has over 15 years of experience working in technical development within the fintech industry. When not writing about tech, Emma can be found writing romantic fiction, reviewing films, and updating her tea blog.

Read more
Holographic login above laptop keyboard
Yes, you can use your browser's password manager – here’s how to do it safely
ExpressVPN connected on Linux app
ExpressVPN launches huge Linux update – what you need to know
MacBook Pro 2021 (16-inch) on a patio table
It's easy to edit PDFs on your Mac — here's how to do it for free
An iPhone, iPad, iMac, and MacBook
3 essential tools for protecting your new device
Dell XPS 8940 review
How to turn your old PC into a storage server
How to Set up a VPN
How to set up a VPN on any device
Latest in Operating Systems
Mac Studio on a desk hooked up to a Studio DIsplay
Mac Studio M3 Ultra: 3 reasons to buy and 2 reasons to skip
Microsoft Office is finally as it should have been on iPad
Microsoft tests free Word, PowerPoint and Excel apps for Windows — expect a lot of ads
laptop anger
Latest Windows 11 update reportedly breaking major parts of the operating system
Windows 10 logo
Windows 10 end of life set for this year — everything you need to know to get ready
Windows 11 logo on a laptop screen
I reviewed Windows 11, and these are the 5 new features I'm most excited about for 2025
A Windows 11 laptop, demonstrating how to run Android apps on Windows 11
How to remove the Windows 11 news and weather widget
Latest in How To
Cleaning with a mop in yellow bucket
Your cleaning tools are spreading dirt — here’s how to disinfect them properly
ChatGPT on iPhone
I tried these 11 ChatGPT tips — and they take my prompts to the next level
Manus AI logo on smartphone screen
How to join Manus — the new AI assistant everyone is talking about
iPhone 16 Pro shown held in hand
You can disable those awkward AI message summaries on iPhone — here's how
Scottie Scheffler of the United States plays a shot from a bunker prior to The Players Championship at TPC Sawgrass
The Players Championship 2025 live stream: how to watch the PGA Tour golf online
White bottle of bleach with cleaning products in blue box
How to get rid of bleach smell in your home — 5 quick tips to do now