Move everything from /var/adm to /var/log
[unleashed.git] / share / man / man4 / shadow.4
bloba91aecb7d15691e4937e12313d12ee7e7eb7220d
1 '\" te
2 .\"  Copyright 1989 AT&T Copyright (c) 2002, Sun Microsystems, Inc. All Rights Reserved
3 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
4 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
5 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
6 .TH SHADOW 4 "Feb 25, 2017"
7 .SH NAME
8 shadow \- shadow password file
9 .SH DESCRIPTION
10 .LP
11 \fB/etc/shadow\fR is an access-restricted ASCII system file that stores users'
12 encrypted passwords and related information. The shadow file can be used in
13 conjunction with other shadow sources, including the \fBNIS\fR maps
14 \fBpasswd.byname\fR and \fBpasswd.byuid\fR.
15 Programs use the \fBgetspnam\fR(3C) routines to access this information.
16 .sp
17 .LP
18 The fields for each user entry are separated by colons. Each user is separated
19 from the next by a newline. Unlike the \fB/etc/passwd\fR file,
20 \fB/etc/shadow\fR does not have general read permission.
21 .sp
22 .LP
23 Each entry in the shadow file has the form:
24 .sp
25 .in +2
26 .nf
27 \fIusername\fR:\fIpassword\fR:\fIlastchg\fR:\fImin\fR:\fImax\fR:\fIwarn\fR:\fIinactive\fR:\fIexpire\fR:\fIflag\fR
28 .fi
29 .in -2
31 .sp
32 .LP
33 The fields are defined as follows:
34 .sp
35 .ne 2
36 .na
37 \fB\fIusername\fR\fR
38 .ad
39 .RS 12n
40 The user's login name (UID).
41 .RE
43 .sp
44 .ne 2
45 .na
46 \fB\fIpassword\fR\fR
47 .ad
48 .RS 12n
49 An encrypted password for the user generated by \fBcrypt\fR(3C), a \fIlock\fR
50 string to indicate that the login is not accessible, or no string, which shows
51 that there is no password for the login.
52 .sp
53 The lock string is defined as \fB*LK*\fR in the first four characters of the
54 password field.
55 .RE
57 .sp
58 .ne 2
59 .na
60 \fB\fIlastchg\fR\fR
61 .ad
62 .RS 12n
63 The number of days between January 1, 1970, and the date that the password was
64 last modified. The \fIlastchg\fR value is a decimal number, as interpreted by
65 \fBstrtol\fR(3C).
66 .RE
68 .sp
69 .ne 2
70 .na
71 \fB\fImin\fR\fR
72 .ad
73 .RS 12n
74 The minimum number of days required between password changes. This field must
75 be set to 0 or above to enable password aging.
76 .RE
78 .sp
79 .ne 2
80 .na
81 \fB\fImax\fR\fR
82 .ad
83 .RS 12n
84 The maximum number of days the password is valid.
85 .RE
87 .sp
88 .ne 2
89 .na
90 \fB\fIwarn\fR\fR
91 .ad
92 .RS 12n
93 The number of days before password expires that the user is warned.
94 .RE
96 .sp
97 .ne 2
98 .na
99 \fB\fIinactive\fR\fR
101 .RS 12n
102 The number of days of inactivity allowed for that user. This is counted on a
103 per-machine basis; the information about the last login is taken from the
104 machine's \fBlastlog\fR file.
108 .ne 2
110 \fB\fIexpire\fR\fR
112 .RS 12n
113 An absolute date expressed as the number of days since the Unix Epoch (January
114 1, 1970). When this number is reached the login can no longer be used. For
115 example, an \fIexpire\fR value of \fB13514\fR specifies a login expiration of
116 January 1, 2007.
120 .ne 2
122 \fB\fIflag\fR\fR
124 .RS 12n
125 Failed login count in low order four bits; remainder reserved for future use,
126 set to zero.
131 A value of \fB-1\fR for \fImin\fR, \fImax\fR, or \fIwarn\fR disables password
132 aging.
135 The encrypted password consists of at most \fBCRYPT_MAXCIPHERTEXTLEN\fR
136 characters chosen from a 64-character alphabet (\fB\&.\fR, \fB/\fR,
137 \fB0\(mi9\fR, \fBA\(miZ\fR, \fBa\(miz\fR). Two additional special characters,
138 "$" and ",", can also be used and are defined in \fBcrypt\fR(3C). To update
139 this file, use the \fBpasswd\fR(1), \fBuseradd\fR(8), \fBusermod\fR(8), or
140 \fBuserdel\fR(8) commands.
143 In order to make system administration manageable, \fB/etc/shadow\fR entries
144 should appear in exactly the same order as \fB/etc/passwd\fR entries; this
145 includes ``+'' and ``-'' entries if the \fBcompat\fR source is being used (see
146 \fBnsswitch.conf\fR(4)).
149 Values for the various time-related fields are interpreted as Greenwich Mean
150 Time.
151 .SH FILES
152 .ne 2
154 \fB\fB/etc/shadow\fR\fR
156 .RS 22n
157 shadow password file
161 .ne 2
163 \fB\fB/etc/passwd\fR\fR
165 .RS 22n
166 password file
170 .ne 2
172 \fB\fB/etc/nsswitch.conf\fR\fR
174 .RS 22n
175 name-service switch configuration file
179 .ne 2
181 \fB\fB/var/log/lastlog.v2\fR\fR
183 .RS 22n
184 time of last login
187 .SH ATTRIBUTES
189 See \fBattributes\fR(5) for descriptions of the following attributes:
194 box;
195 c | c
196 l | l .
197 ATTRIBUTE TYPE  ATTRIBUTE VALUE
199 Interface Stability     Stable
202 .SH SEE ALSO
204 \fBlogin\fR(1), \fBpasswd\fR(1), \fBuseradd\fR(8), \fBuserdel\fR(8),
205 \fBusermod\fR(8), \fBstrtol\fR(3C), \fBcrypt\fR(3C), \fBcrypt_gensalt\fR(3C),
206 \fBgetspnam\fR(3C), \fBputspent\fR(3C), \fBnsswitch.conf\fR(4),
207 \fBpasswd\fR(4), \fBattributes\fR(5), \fBpam_unix_account\fR(5),
208 \fBpam_unix_auth\fR(5)
209 .SH NOTES
211 If password aging is turned on in any name service the \fIpasswd:\fR line in
212 the \fB/etc/nsswitch.conf\fR file must have a format specified in the
213 \fBnsswitch.conf\fR(4) man page.
216 If the \fB/etc/nsswitch.conf\fR passwd policy is not in one of the supported
217 formats, logins will not be allowed upon password expiration, because the
218 software does not know how to handle password updates under these conditions.
219 See \fBnsswitch.conf\fR(4) for additional information.