🇩🇪 DE 🇬🇧 EN
NexoraHost / Docs home
Popular searches:Minecraft won't startCreate Minecraft serverFiveM txAdminInstall WordPressSet up subdomainVPS GermanySSL errorOpen port 25565Discord bot hostingDNS troubleshooting

Managing Users and Permissions on Linux<

This guide shows you how to create and manage users on your Linux server and assign the appropriate permissions. Clean user management is essential for your server's security.

Note: Detailed subpages on security and advanced topics can be found in the left navigation.

Why Multiple Users?

Creating and Managing Users

Create a New User

# Create user with home directory
adduser username

# Or with useradd (more options)
useradd -m -s /bin/bash username

# Set password
passwd username

Add Users to Groups

# Add to sudo group (admin rights)
usermod -aG sudo username

# Add to a specific group
usermod -aG groupname username

# Show groups of a user
groups username

List and Delete Users

# Show all users
cat /etc/passwd

# Only "real" users (with shell)
grep -v /nologin /etc/passwd

# Delete user (with home directory)
userdel -r username

Understanding File Permissions

-rwxr-xr-- 1 user group 1024 May 28 12:00 file.txt
 ─┬─ ─┬─ ─┬─
  │   │   └── Permissions for others (Others)
  │   └────── Permissions for the group (Group)
  └────────── Permissions for the owner (Owner)

Change Permissions with chmod

# File readable and writable for owner, readable for group and others
chmod 644 file.txt

# Folder: owner has all rights, group and others can read and enter
chmod 755 folder

# Make script executable
chmod +x script.sh

# Recursively for all files in a folder
chmod -R 755 /var/www

Change Owner with chown

# Change owner and group
chown user:group file.txt

# Recursively for an entire folder
chown -R www-data:www-data /var/www

Important System Users

User Purpose
root Administrator – only use for system tasks
www-data Web server (Apache/Nginx) – website files belong to this user
mysql Database server – database files belong to this user

Common Problems

"Permission denied" despite correct permissions:

sudo not working:

Detailed guides on security and advanced topics can be found in the articles in the left navigation.

NexoraHost

Your own server

Root access for Linux admins – secure with our VPS/root guides.

nexorahost.com · Maincubes FRA01 · 1 Tbit/s DDoS · 99,9 % Uptime