Linux

Where Are Linux Users and Passwords Stored?

/etc/passwd, shadow, group and gshadow roles plus the useradd and passwd commands that edit them.

Last updated

Linux splits identity across four files: passwd maps names to UIDs and shells, shadow holds password hashes, group and gshadow cover memberships. Only shadow stays root only.

Edit with useradd, usermod and passwd, not a text editor. The pwck and grpck checkers validate the files after changes.

Where Linux stores this, by platform

Linux
/etc/passwd

World readable by design; hashes live in /etc/shadow (root only). Groups in /etc/group with secrets in /etc/gshadow.

Frequently asked questions

Why is there an x where the password should be?

Modern systems store hashes in shadow, leaving x as a pointer. That split is what keeps hashes out of world readable files.

How do I list all real users?

Filter passwd for interactive shells and UID ranges. System accounts share the same file withnologin shells.

Notice an outdated path? Let us know.