-
-
Notifications
You must be signed in to change notification settings - Fork 1
Linux useradd Guide
Mattscreative edited this page Dec 5, 2025
·
2 revisions
Complete beginner-friendly guide to useradd on Linux, covering Arch Linux, CachyOS, and other distributions including creating users, user configuration, and user management.
useradd creates new user accounts.
Uses:
- Create users: Add new user accounts
- Set defaults: Configure user defaults
- User management: Manage system users
- Multi-user systems: Support multiple users
Why it matters:
- Security: Separate user accounts
- Organization: Organize system access
- Permissions: Control file access
Create user:
# Create user
sudo useradd username
# Create with home directory
sudo useradd -m username
# Set password
sudo passwd usernameAdd to groups:
# Create user in wheel group
sudo useradd -m -G wheel username
# Create with specific UID
sudo useradd -m -u 1001 usernameCommon options:
# Create user with options
sudo useradd -m -s /bin/bash -G wheel,users username
# Options:
# -m: Create home directory
# -s: Set shell
# -G: Add to groups
# -u: Set UID
# -g: Set primary groupSet shell:
# Create with zsh
sudo useradd -m -s /bin/zsh username
# Create with fish
sudo useradd -m -s /usr/bin/fish usernameChange user:
# Modify user
sudo usermod -aG group username
# Change shell
sudo usermod -s /bin/zsh username
# Lock account
sudo usermod -L usernameRemove user:
# Delete user
sudo userdel username
# Delete with home directory
sudo userdel -r usernameCheck issues:
# Check if user exists
id username
# Check groups
groups username
# Check home directory
ls -la /home/usernameThis guide covered useradd usage, user creation, and management for Arch Linux, CachyOS, and other distributions.
- User and Groups - User management
- passwd Guide - Password management
- sudo Guide - sudo setup
-
useradd Documentation:
man useradd
This guide covers Arch Linux, CachyOS, and other Linux distributions. For distribution-specific details, refer to your distribution's documentation.