wiki:debian-users-and-groups
Table of Contents
Debian Users and Groups
Every process on Debian runs as a user. Users have numeric identifiers (UIDs), groups have GIDs. Permissions and resource limits are assigned per-user and per-group.
Adding Users
Create a user with a home directory:
useradd -m username
The interactive version (prompts for gecos, shell, etc.):
adduser username
Set password:
passwd username
Removing Users
Delete user but keep home directory:
deluser username
Delete user and home:
deluser --remove-home username
Groups
Create a group:
groupadd groupname
Add user to group:
usermod -aG groupname username
The -a appends; without it, existing groups are replaced.
List groups for user:
groups username
Common Groups
sudo— run commands withsudodocker— use Docker withoutsudoaudio— access audio devicesvideo— access video deviceswww-data— web server process owneradm— read log files
Listing Users
cut -d: -f1 /etc/passwd
View full user info:
getent passwd username
User Configuration Files
/etc/passwd— user accounts (readable, no passwords)/etc/shadow— hashed passwords (root-only)/etc/group— group definitions/etc/gshadow— group passwords (rarely used)
Changes made with useradd, usermod, groupadd update these files automatically. Manual editing is possible but error-prone; use the commands instead.
wiki/debian-users-and-groups.md · Last modified: by 127.0.0.1
