image.png

This article explains how Linux handles user authentication through the /etc/passwd and /etc/shadow files.

Originally written for educational purposes as part of my Linux Privilege Escalation series.


/etc/passwd

This file stores information about the system’s users.

It is owned by the root user.

User information is stored in seven fields, each separated by a colon (:).

image.png


/etc/shadow

This file contains encrypted password data and related information for system users.

It is also owned by root.

Each line in this file consists of nine fields, also separated by colons (:).

image.png


2. Encrypted Password Format

The password field typically uses the format: