Home

etcpasswd

Etcpasswd refers to the /etc/passwd file, a foundational component of most Unix-like operating systems. It is a plain text file that stores basic information about user accounts and is consulted during login and account lookups. Historically, it also held password information, but modern systems separate passwords into a shadow file to improve security. While /etc/passwd is world-readable, sensitive password hashes are typically kept in /etc/shadow, which has restricted permissions.

Each line in /etc/passwd represents a single user and contains seven fields separated by colons: the login

Security and access considerations are central to /etc/passwd’s design. Because the file is readable by all

The file is used in conjunction with system libraries and services such as Name Service Switch (NSS)

Administration of accounts is typically performed with dedicated tools (for example, useradd, usermod, userdel, and passwd)

name,
the
password
field
(historically
the
encrypted
password;
on
current
systems
often
an
x
or
*
indicating
a
shadowed
password),
the
User
ID
(UID),
the
Group
ID
(GID),
a
GECOS
field
for
the
user’s
full
name
or
description,
the
home
directory,
and
the
login
shell.
Example:
root:x:0:0:root:/root:/bin/bash.
users,
actual
password
hashes
should
not
be
stored
there.
Instead,
the
hashes
live
in
/etc/shadow,
which
is
readable
only
by
root
and
certain
trusted
processes.
The
presence
of
shadow
files
allows
password
management
and
aging
policies
to
be
enforced
more
securely.
and
Pluggable
Authentication
Modules
(PAM),
which
may
source
account
information
from
/etc/passwd
or
from
network-backed
services
like
LDAP
or
NIS
depending
on
configuration.
rather
than
manual
edits
to
/etc/passwd.
To
query
account
information,
utilities
like
getent
passwd
consult
NSS
databases
and
files
in
a
unified
manner.
See
also
/etc/shadow,
/etc/group,
and
getent.