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

Listing Users

cut -d: -f1 /etc/passwd

View full user info:

getent passwd username

User Configuration Files

Changes made with useradd, usermod, groupadd update these files automatically. Manual editing is possible but error-prone; use the commands instead.