Fundamentals 5 min read

Master Linux Users and Groups: Permissions, Files, and Management Commands

Learn the essential concepts of Linux user and group management, including user types, the structure of /etc/passwd and /etc/shadow, group definitions, permission inheritance, and practical commands such as useradd, usermod, groupadd, and userdel for creating, modifying, and deleting accounts.

MaGe Linux Operations
MaGe Linux Operations
MaGe Linux Operations
Master Linux Users and Groups: Permissions, Files, and Management Commands

1. Users

A user is a collection of permissions to access system resources.

Linux user categories

a. Administrator (root): has all system permissions, UID 0.

b. Regular user: limited permissions, UID 500‑60000.

c. System user: for system operation, no password login, UID 1‑499.

Files related to users

/etc/passwd

Format: account:password:UID:GID:GECOS:directory:shell

account – username

password – placeholder

UID – user ID

GID – primary group ID

GECOS – detailed info (name, age, phone, etc.)

directory – home directory

shell – login shell

/etc/shadow

Format: account:password:last_change:min:max:warn:inactive:expire:reserved

4. User groups

Group categories:

Regular group: multiple users can join.

System group: typically contains system users.

Private (primary) group: created with a user if no group specified; name matches username; can become regular group when other users are added.

5. Groups as permission containers

Users inherit permissions of the groups they belong to.

6. Files related to groups

/etc/group

Format: group_name:password:GID:user_list

group_name – name of the group

password – group password

GID – group ID

user_list – list of users belonging to the group

7. Commands to manage users and groups

useradd, usermod, groupadd, userdel

Add user

useradd [options] username

Options:

-u UID

-g GID

-d home_directory (default /home/username)

-s shell

-G supplementary_groups

Example:

# useradd -u 1888 -d /home/oracle -s /bin/sh wendy

Modify user

usermod [options] username

Options similar to useradd; -m with -b moves home directory contents.

Example:

# usermod -u 1000 -d /oracle -s /bin/bash -m wendy

Add group

groupadd [options] groupname

Option:

-g GID

Example:

# groupadd -g 1001 grp

Delete user

userdel [options] username

Option:

-r remove home directory

Example:

# userdel -r wendy
Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

LinuxSystem AdministrationUser ManagementPermissionsGroups
MaGe Linux Operations
Written by

MaGe Linux Operations

Founded in 2009, MaGe Education is a top Chinese high‑end IT training brand. Its graduates earn 12K+ RMB salaries, and the school has trained tens of thousands of students. It offers high‑pay courses in Linux cloud operations, Python full‑stack, automation, data analysis, AI, and Go high‑concurrency architecture. Thanks to quality courses and a solid reputation, it has talent partnerships with numerous internet firms.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.