Merge from vendor branch GCC:
[dragonfly.git] / usr.bin / passwd / passwd.1
1 .\" Copyright (c) 1990, 1993
2 .\"     The Regents of the University of California.  All rights reserved.
3 .\"
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
6 .\" are met:
7 .\" 1. Redistributions of source code must retain the above copyright
8 .\"    notice, this list of conditions and the following disclaimer.
9 .\" 2. Redistributions in binary form must reproduce the above copyright
10 .\"    notice, this list of conditions and the following disclaimer in the
11 .\"    documentation and/or other materials provided with the distribution.
12 .\" 3. All advertising materials mentioning features or use of this software
13 .\"    must display the following acknowledgement:
14 .\"     This product includes software developed by the University of
15 .\"     California, Berkeley and its contributors.
16 .\" 4. Neither the name of the University nor the names of its contributors
17 .\"    may be used to endorse or promote products derived from this software
18 .\"    without specific prior written permission.
19 .\"
20 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
21 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23 .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
24 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 .\" SUCH DAMAGE.
31 .\"
32 .\"     @(#)passwd.1    8.1 (Berkeley) 6/6/93
33 .\" $FreeBSD: src/usr.bin/passwd/passwd.1,v 1.18.2.5 2002/06/21 15:28:37 charnier Exp $
34 .\" $DragonFly: src/usr.bin/passwd/passwd.1,v 1.5 2006/03/26 22:56:57 swildner Exp $
35 .\"
36 .Dd June 6, 1993
37 .Dt PASSWD 1
38 .Os
39 .Sh NAME
40 .Nm passwd ,
41 .Nm yppasswd
42 .Nd modify a user's password
43 .Sh SYNOPSIS
44 .Nm
45 .Op Fl l
46 .Op Ar user
47 .Nm yppasswd
48 .Op Fl l
49 .Op Fl y
50 .Op Fl d Ar domain
51 .Op Fl h Ar host
52 .Op Fl o
53 .Sh DESCRIPTION
54 The
55 .Nm
56 utility changes the user's local, Kerberos, or NIS password.
57 If the user is not the super-user,
58 .Nm
59 first prompts for the current password and will not continue unless the correct
60 password is entered.
61 .Pp
62 When entering the new password, the characters entered do not echo, in order to
63 avoid the password being seen by a passer-by.
64 The
65 .Nm
66 utility prompts for the new password twice in order to detect typing errors.
67 .Pp
68 The new password should be at least six characters long (which
69 may be overridden using the
70 .Xr login.conf 5
71 .Dq minpasswordlen
72 setting for a user's login class) and not purely alphabetic.
73 Its total length must be less than
74 .Dv _PASSWORD_LEN
75 (currently 128 characters).
76 .Pp
77 The new password should contain a mixture of upper and lower case
78 characters (which may be overridden using the
79 .Xr login.conf 5
80 .Dq mixpasswordcase
81 setting for a user's login class).
82 Allowing lower case passwords may
83 be useful where the password file will be used in situations where only
84 lower case passwords are permissible, such as when using Samba to
85 authenticate Windows clients.
86 In all other situations, numbers, upper
87 case letters and meta characters are encouraged.
88 .Pp
89 Once the password has been verified,
90 .Nm
91 communicates the new password information to
92 the Kerberos authenticating host.
93 .Bl -tag -width flag
94 .It Fl l
95 This option causes the password to be updated only in the local
96 password file, and not with the Kerberos database.
97 When changing only the local password,
98 .Xr pwd_mkdb 8
99 is used to update the password databases.
100 .El
101 When changing local or NIS password, the next password change date
102 is set according to
103 .Dq passwordtime
104 capability in the user's login class.
105 .Pp
106 To change another user's Kerberos password, one must first
107 run
108 .Xr kinit 1
109 followed by
110 .Xr passwd 1 .
111 The super-user is not required to provide a user's current password
112 if only the local password is modified.
113 .Sh NIS INTERACTION
114 The
115 .Nm
116 utility has built-in support for NIS.
117 If a user exists in the NIS password
118 database but does not exist locally,
119 .Nm
120 automatically switches into
121 .Dq yppasswd
122 mode.
123 If the specified
124 user does not exist in either the local password database of the
125 NIS password maps,
126 .Nm
127 returns an error.
128 .Pp
129 When changing an NIS password, unprivileged users are required to provide
130 their old password for authentication (the
131 .Xr rpc.yppasswdd 8
132 daemon requires the original password before
133 it will allow any changes to the NIS password maps).
134 This restriction applies even to the
135 super-user, with one important exception: the password authentication is
136 bypassed for the super-user on the NIS master server.
137 This means that
138 the super-user on the NIS master server can make unrestricted changes to
139 anyone's NIS password.
140 The super-user on NIS client systems and NIS slave
141 servers still needs to provide a password before the update will be processed.
142 .Pp
143 The following additional options are supported for use with NIS:
144 .Bl -tag -width flag
145 .It Fl y
146 The
147 .Fl y
148 flag overrides
149 .Nm Ns 's
150 checking heuristics and forces
151 it into NIS mode.
152 .It Fl l
153 When NIS is enabled, the
154 .Fl l
155 flag can be used to force
156 .Nm
157 into
158 .Dq local only
159 mode.
160 This flag can be used to change the entry
161 for a local user when an NIS user exists with the same login name.
162 For example, you will sometimes find entries for system
163 .Dq placeholder
164 users such as
165 .Pa bin
166 or
167 .Pa daemon
168 in both the NIS password maps and the local user database.
169 By
170 default,
171 .Nm
172 will try to change the NIS password.
173 The
174 .Fl l
175 flag can be used to change the local password instead.
176 .It Fl d Ar domain
177 Specify what domain to use when changing an NIS password.
178 By default,
179 .Nm
180 assumes that the system default domain should be used.
181 This flag is
182 primarily for use by the superuser on the NIS master server: a single
183 NIS server can support multiple domains.
184 It is also possible that the
185 domainname on the NIS master may not be set (it is not necessary for
186 an NIS server to also be a client) in which case the
187 .Nm
188 command needs to be told what domain to operate on.
189 .It Fl h Ar host
190 Specify the name of an NIS server.
191 This option, in conjunction
192 with the
193 .Fl d
194 option, can be used to change an NIS password on a non-local NIS
195 server.
196 When a domain is specified with the
197 .Fl d
198 option and
199 .Nm
200 is unable to determine the name of the NIS master server (possibly because
201 the local domainname isn't set), the name of the NIS master is assumed to
202 be
203 .Dq localhost .
204 This can be overridden with the
205 .Fl h
206 flag.
207 The specified hostname need not be the name of an NIS master: the
208 name of the NIS master for a given map can be determined by querying any
209 NIS server (master or slave) in a domain, so specifying the name of a
210 slave server will work equally well.
211 .Pp
212 .It Fl o
213 Do not automatically override the password authentication checks for the
214 super-user on the NIS master server; assume 'old' mode instead.
215 This
216 flag is of limited practical use but is useful for testing.
217 .El
218 .Sh FILES
219 .Bl -tag -width /etc/master.passwd -compact
220 .It Pa /etc/master.passwd
221 The user database
222 .It Pa /etc/passwd
223 A Version 7 format password file
224 .It Pa /etc/passwd.XXXXXX
225 Temporary copy of the password file
226 .It Pa /etc/login.conf
227 Login class capabilities database
228 .It Pa /etc/auth.conf
229 configure authentication services
230 .El
231 .Sh SEE ALSO
232 .Xr chpass 1 ,
233 .Xr kerberos 1 ,
234 .Xr kinit 1 ,
235 .Xr login 1 ,
236 .Xr login.conf 5 ,
237 .Xr passwd 5 ,
238 .Xr kpasswdd 8 ,
239 .Xr pwd_mkdb 8 ,
240 .Xr vipw 8
241 .Rs
242 .%A Robert Morris
243 .%A Ken Thompson
244 .%T "UNIX password security"
245 .Re
246 .Sh NOTES
247 The
248 .Xr yppasswd 1
249 command is really only a link to
250 .Nm .
251 .Sh HISTORY
252 A
253 .Nm
254 command appeared in
255 .At v6 .