configuration

/etc/passwd — Local account records

Local account database with seven colon-delimited fields. On shadow-password systems x is a placeholder, not a password. UID identifies the account; primary GID refers to a group. GECOS is descriptive text; HOME and SHELL identify intended paths. NSS can obtain users from additional sources, so this file alone does not enumerate all identities. Do not manually edit production account databases; use account-management tools and validate in a VM. Existing processes do not automatically adopt changed credentials.

Formal Syntax & Structure

linux syntaxlinux
NAME:PASSWORD:UID:GID:GECOS:HOME:SHELL

Parameters & Attributes

NameTypeDescription
NAMEfieldLogin name
PASSWORDfieldPassword field or placeholder
UIDfieldNumeric user ID
GIDfieldPrimary group ID
GECOSfieldDescriptive account information
HOMEfieldHome directory
SHELLfieldLogin shell

Return Value

configuration or inspection

A record describes account attributes, not active sessions or authorization. getent passwd NAME performs NSS lookup.

Working Example

Example Snippetlinux
printf '%s\n' 'bmstudent:x:2001:2001:Demo account:/home/bmstudent:/bin/bash' | awk -F: 'NF==7 {print $1, $3, $4, $6}'
Linux Reference