LinuxCommandLibrary

pwck

Verify password file integrity and consistency

TLDR

Check password file integrity

$ pwck
copy
Check specific files
$ pwck [/etc/passwd] [/etc/shadow]
copy
Read-only check
$ pwck -r
copy
Quiet mode
$ pwck -q
copy

SYNOPSIS

pwck [options] [passwd] [shadow]

DESCRIPTION

pwck verifies the integrity of /etc/passwd and /etc/shadow files by checking for proper formatting, valid field values, and internal consistency. It detects problems like duplicate usernames, invalid UIDs/GIDs, missing home directories, and entries that don't match between the password and shadow files.
By default pwck prompts to delete invalid entries, but the -r flag runs in read-only mode for auditing without making changes. The command is part of shadow-utils and is typically run by administrators after manual edits to password files or as part of system health checks.

PARAMETERS

PASSWD

Password file path.
SHADOW
Shadow file path.
-r
Read-only mode.
-q
Quiet output.
-s
Sort by UID.

CAVEATS

Requires root for shadow file. System administration tool.

HISTORY

pwck is a shadow-utils utility for password file verification.

SEE ALSO

grpck(8), passwd(1), shadow(5)

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community