Linux User Groups - ryzendew/Linux-Tips-and-Tricks GitHub Wiki
Linux User and Groups Guide
Complete beginner-friendly guide to user and group management on Linux, covering Arch Linux, CachyOS, and other distributions including creating users, managing groups, permissions, and user administration.
Table of Contents
User Management
Create User
Add user:
# Create user
sudo useradd -m -G wheel username
# Set password
sudo passwd username
Modify User
Modify user:
# Change shell
sudo usermod -s /bin/zsh username
# Add to group
sudo usermod -aG group-name username
# Lock account
sudo usermod -L username
# Unlock account
sudo usermod -U username
Delete User
Remove user:
# Remove user
sudo userdel username
# Remove with home
sudo userdel -r username
Group Management
Create Group
Add group:
# Create group
sudo groupadd group-name
# Add user to group
sudo usermod -aG group-name username
Common Groups
Important groups:
- wheel: Sudo access
- audio: Audio device access
- video: Video device access
- lp: Printer access
- scanner: Scanner access
Modify Group
Modify group:
# Add user to group
sudo usermod -aG group-name username
# Remove user from group
sudo gpasswd -d username group-name
Permissions
File Permissions
Set permissions:
# Set permissions
chmod 755 file
# Set ownership
sudo chown user:group file
Directory Permissions
Set directory permissions:
# Set permissions
chmod 755 directory
# Recursive
chmod -R 755 directory
User Administration
List Users
List users:
# List users
cat /etc/passwd
# List logged in
who
# List with details
w
User Information
Check user:
# User info
id username
# Groups
groups username
Troubleshooting
Permission Denied
Fix permissions:
# Check permissions
ls -l file
# Fix ownership
sudo chown user:group file
User Not in Group
Add to group:
# Add to group
sudo usermod -aG group-name username
# Log out and back in
Summary
This guide covered user and group management for Arch Linux, CachyOS, and other distributions, including creating users, managing groups, and permissions.
Next Steps
- Security Configuration - Security setup
- System Configuration - System setup
- ArchWiki Users and Groups: https://wiki.archlinux.org/title/Users_and_groups
This guide covers Arch Linux, CachyOS, and other Linux distributions. For distribution-specific details, refer to your distribution's documentation.