]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man5/passwd.5
Many pages: Fix style issues reported by `make lint-groff`
[thirdparty/man-pages.git] / man5 / passwd.5
CommitLineData
3d54a910
MK
1.\" Copyright (c) 1993 Michael Haardt (michael@moria.de),
2.\" Fri Apr 2 11:32:09 MET DST 1993
fea681da 3.\"
e4a74ca8 4.\" SPDX-License-Identifier: GPL-2.0-or-later
fea681da
MK
5.\"
6.\" Modified Sun Jul 25 10:46:28 1993 by Rik Faith (faith@cs.unc.edu)
7.\" Modified Sun Aug 21 18:12:27 1994 by Rik Faith (faith@cs.unc.edu)
8.\" Modified Sun Jun 18 01:53:57 1995 by Andries Brouwer (aeb@cwi.nl)
9.\" Modified Mon Jan 5 20:24:40 MET 1998 by Michael Haardt
10.\" (michael@cantor.informatik.rwth-aachen.de)
09b8afdc 11.TH PASSWD 5 2018-04-30 "Linux" "Linux Programmer's Manual"
fea681da
MK
12.SH NAME
13passwd \- password file
14.SH DESCRIPTION
df0c9b98 15The
1ae6b2c7 16.I /etc/passwd
df0c9b98
MK
17file is a text file that describes user login accounts for the system.
18It should have read permission allowed for all users (many utilities, like
fea681da 19.BR ls (1)
18701562 20use it to map user IDs to usernames), but write access only for the
fea681da
MK
21superuser.
22.PP
23In the good old days there was no great problem with this general
c13182ef
MK
24read permission.
25Everybody could read the encrypted passwords, but the
df0c9b98 26hardware was too slow to crack a well-chosen password, and moreover the
c13182ef
MK
27basic assumption used to be that of a friendly user-community.
28These days many people run some version of the shadow password suite, where
fea681da 29.I /etc/passwd
c1b273fc 30has an \(aqx\(aq character in the password field,
30f7100e 31and the encrypted passwords are in
df0c9b98 32.IR /etc/shadow ,
fea681da
MK
33which is readable by the superuser only.
34.PP
c3e1cb40
MK
35If the encrypted password, whether in
36.I /etc/passwd
37or in
38.IR /etc/shadow ,
39is an empty string, login is allowed without even asking for a password.
40Note that this functionality may be intentionally disabled in applications,
41or configurable (for example using the "nullok" or "nonull" arguments to
42pam_unix.so).
43.PP
44If the encrypted password in
45.I /etc/passwd
46is "\fI*NP*\fP" (without the quotes),
47the shadow record should be obtained from an NIS+ server.
48.PP
df0c9b98 49Regardless of whether shadow passwords are used, many system administrators
156f55f6 50use an asterisk (*) in the encrypted password field to make sure
60ae21db 51that this user can not authenticate themself using a
6387216b 52password.
df0c9b98 53(But see NOTES below.)
fea681da 54.PP
156f55f6 55If you create a new login, first put an asterisk (*) in the password field,
fea681da
MK
56then use
57.BR passwd (1)
58to set it.
59.PP
60017fa5
MK
60Each line of the file describes a single user,
61and contains seven colon-separated fields:
bdd915e2
MK
62.PP
63.in +4n
64.EX
60017fa5 65name:password:UID:GID:GECOS:directory:shell
bdd915e2
MK
66.EE
67.in
68.PP
df0c9b98 69The field are as follows:
f03743fd 70.TP 12
60017fa5
MK
71.I name
72This is the user's login name.
c13182ef 73It should not contain capital letters.
fea681da
MK
74.TP
75.I password
60017fa5
MK
76This is either the encrypted user password,
77an asterisk (*), or the letter \(aqx\(aq.
30f7100e
MK
78(See
79.BR pwconv (8)
f81fb444 80for an explanation of \(aqx\(aq.)
fea681da
MK
81.TP
82.I UID
60017fa5
MK
83The privileged
84.I root
85login account (superuser) has the user ID 0.
fea681da
MK
86.TP
87.I GID
60017fa5
MK
88This is the numeric primary group ID for this user.
89(Additional groups for the user are defined in the system group file; see
90.BR group (5)).
fea681da
MK
91.TP
92.I GECOS
60017fa5
MK
93This field (sometimes called the "comment field")
94is optional and used only for informational purposes.
18701562 95Usually, it contains the full username.
60017fa5
MK
96Some programs (for example,
97.BR finger (1))
98display information from this field.
99.IP
df0c9b98
MK
100GECOS stands for "General Electric Comprehensive Operating System",
101which was renamed to GCOS when
c13182ef
MK
102GE's large systems division was sold to Honeywell.
103Dennis Ritchie has reported: "Sometimes we sent printer output or
104batch jobs to the GCOS machine.
105The gcos field in the password file was a place to stash the
106information for the $IDENTcard.
107Not elegant."
fea681da
MK
108.TP
109.I directory
60017fa5
MK
110This is the user's home directory:
111the initial directory where the user is placed after logging in.
112The value in this field is used to set the
113.B HOME
114environment variable.
fea681da
MK
115.TP
116.I shell
60017fa5 117This is the program to run at login (if empty, use
8478ee02 118.IR /bin/sh ).
f74bac5d 119If set to a nonexistent executable, the user will be unable to login
fea681da
MK
120through
121.BR login (1).
60017fa5
MK
122The value in this field is used to set the
123.B SHELL
124environment variable.
2b2581ee
MK
125.SH FILES
126.I /etc/passwd
19c98696 127.SH NOTES
df0c9b98
MK
128If you want to create user groups, there must be an entry in
129.IR /etc/group ,
130or no group will exist.
fea681da 131.PP
156f55f6 132If the encrypted password is set to an asterisk (*), the user will be unable
fea681da
MK
133to login using
134.BR login (1),
135but may still login using
136.BR rlogin (1),
137run existing processes and initiate new ones through
138.BR rsh (1),
49ec013c 139.BR cron (8),
fea681da 140.BR at (1),
c13182ef
MK
141or mail filters, etc.
142Trying to lock an account by simply changing the
fea681da
MK
143shell field yields the same result and additionally allows the use of
144.BR su (1).
47297adb 145.SH SEE ALSO
64f7f61e
MK
146.BR chfn (1),
147.BR chsh (1),
fea681da
MK
148.BR login (1),
149.BR passwd (1),
150.BR su (1),
0ec954ee 151.BR crypt (3),
b22e49b8
MK
152.BR getpwent (3),
153.BR getpwnam (3),
fea681da 154.BR group (5),
a77696ad
MK
155.BR shadow (5),
156.BR vipw (8)