← Users & Permissions
Linux · Users & Permissions

How to create a user in Linux

Create a user account with useradd, set the password, and grant sudo, then verify the account.


Create a user with a home directory and shell, set a password, and optionally grant sudo. Run as root.

Creating a user and granting sudo gives real access to the server. Set a strong password, and add the account to the sudo/wheel group only if it truly needs administrative rights.

# Create with a home directory and bash shell
sudo useradd -m -s /bin/bash <user>

# Set the password
sudo passwd <user>

# Grant sudo (RHEL/OL: wheel, Debian/Ubuntu: sudo)
sudo usermod -aG wheel <user>

# Verify
id <user>
getent passwd <user>
LinuxuseraddUsers