Windows
Linux
Security & Permissions
Users & Groups
Windows net user equivalent in Linux
Adds new users, changes user properties, and manages user accounts on the system.
Windows
→
net user
Linux equivalents
useradd / usermod
useradd / usermod
useradd / usermod
Overview
What this command does
Adds new users, changes user properties, and manages user accounts on the system.
Migration tip: Use
adduser (note: no dash) instead of useradd on Debian/Ubuntu — it's friendlier and sets up the home directory interactively.Practical tasks
Common use cases
Create and manage user accounts
Adds new users, changes user properties, and manages user accounts on the system.
adduser username
Create user interactively (recommended)
useradd -m username
Create user with home directory
usermod -aG group user
Add user to a group
Ready to run
Copyable Linux commands
Review paths, device names, package names and permissions before running any command.
sudo adduser john
sudo passwd john
sudo usermod -aG sudo john
sudo usermod -aG wheel john
sudo userdel -r john
Walkthrough
Examples with explanations
# Windows: net user john Password1 /add
sudo adduser john # create user (interactive)
sudo passwd john # set/change password
# Add to sudo group (give admin rights):
sudo usermod -aG sudo john # Ubuntu/Debian
sudo usermod -aG wheel john # Fedora/RHEL
# Delete user:
sudo userdel -r john # remove user + home dir
Reference
Common options and variations
| Command or option | Use |
|---|---|
adduser username | Create user interactively (recommended) |
useradd -m username | Create user with home directory |
usermod -aG group user | Add user to a group |
passwd username | Set or change user password |
userdel -r username | Delete user and their home directory |
cat /etc/passwd | List all user accounts |
Distro differences
Debian/Ubuntu vs Fedora vs Arch
This command is the same on Debian/Ubuntu, Fedora and Arch Linux when the relevant tool is installed.
| Distribution | Package manager / base | Equivalent command | Difference to notice |
|---|---|---|---|
| Debian/Ubuntu | same command | useradd / usermod |
Same command on this distribution. |
| Fedora | same command | useradd / usermod |
Same command on this distribution. |
| Arch | same command | useradd / usermod |
Same command on this distribution. |
Keep learning