Add the DragonFly cvs id and perform general cleanups on cvs/rcs/sccs ids. Most
[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.2 2003/06/17 04:29:30 dillon Exp $
35 .\"
36 .Dd June 6, 1993
37 .Dt PASSWD 1
38 .Os
39 .Sh NAME
40 .Nm passwd , yppasswd
41 .Nd modify a user's password
42 .Sh SYNOPSIS
43 .Nm
44 .Op Fl l
45 .Op Ar user
46 .Nm yppasswd
47 .Op Fl l
48 .Op Fl y
49 .Op Fl d Ar domain
50 .Op Fl h Ar host
51 .Op Fl o
52 .Sh DESCRIPTION
53 The
54 .Nm
55 utility changes the user's local, Kerberos, or NIS password.
56 If the user is not the super-user,
57 .Nm
58 first prompts for the current password and will not continue unless the correct
59 password is entered.
60 .Pp
61 When entering the new password, the characters entered do not echo, in order to
62 avoid the password being seen by a passer-by.
63 The
64 .Nm
65 utility prompts for the new password twice in order to detect typing errors.
66 .Pp
67 The new password should be at least six characters long (which
68 may be overridden using the
69 .Xr login.conf 5
70 .Dq minpasswordlen
71 setting for a user's login class) and not purely alphabetic.
72 Its total length must be less than
73 .Dv _PASSWORD_LEN
74 (currently 128 characters).
75 .Pp
76 The new password should contain a mixture of upper and lower case
77 characters (which may be overridden using the
78 .Xr login.conf 5
79 .Dq mixpasswordcase
80 setting for a user's login class).  Allowing lower case passwords may
81 be useful where the password file will be used in situations where only
82 lower case passwords are permissible, such as when using Samba to
83 authenticate Windows clients.  In all other situations, numbers, upper
84 case letters and meta characters are encouraged.
85 .Pp
86 Once the password has been verified,
87 .Nm
88 communicates the new password information to
89 the Kerberos authenticating host.
90 .Bl -tag -width flag
91 .It Fl l
92 This option causes the password to be updated only in the local
93 password file, and not with the Kerberos database.
94 When changing only the local password,
95 .Xr pwd_mkdb  8
96 is used to update the password databases.
97 .Pp
98 .El
99 When changing local or NIS password, the next password change date
100 is set according to
101 .Dq passwordtime
102 capability in the user's login class.
103 .Pp
104 To change another user's Kerberos password, one must first
105 run
106 .Xr kinit 1
107 followed by
108 .Xr passwd 1 .
109 The super-user is not required to provide a user's current password
110 if only the local password is modified.
111 .Sh NIS INTERACTION
112 The
113 .Nm
114 utility has built-in support for NIS.
115 If a user exists in the NIS password
116 database but does not exist locally,
117 .Nm
118 automatically switches into
119 .Dq yppasswd
120 mode.
121 If the specified
122 user does not exist in either the local password database of the
123 NIS password maps,
124 .Nm
125 returns an error.
126 .Pp
127 When changing an NIS password, unprivileged users are required to provide
128 their old password for authentication (the
129 .Xr rpc.yppasswdd 8
130 daemon requires the original password before
131 it will allow any changes to the NIS password maps).
132 This restriction applies even to the
133 super-user, with one important exception: the password authentication is
134 bypassed for the super-user on the NIS master server.
135 This means that
136 the super-user on the NIS master server can make unrestricted changes to
137 anyone's NIS password.
138 The super-user on NIS client systems and NIS slave
139 servers still needs to provide a password before the update will be processed.
140 .Pp
141 The following additional options are supported for use with NIS:
142 .Bl -tag -width flag
143 .It Fl y
144 The
145 .Fl y
146 flag overrides
147 .Nm Ns 's
148 checking heuristics and forces
149 it into NIS mode.
150 .It Fl l
151 When NIS is enabled, the
152 .Fl l
153 flag can be used to force
154 .Nm
155 into
156 .Dq local only
157 mode.
158 This flag can be used to change the entry
159 for a local user when an NIS user exists with the same login name.
160 For example, you will sometimes find entries for system
161 .Dq placeholder
162 users such as
163 .Pa bin
164 or
165 .Pa daemon
166 in both the NIS password maps and the local user database.
167 By
168 default,
169 .Nm
170 will try to change the NIS password.
171 The
172 .Fl l
173 flag can be used to change the local password instead.
174 .It Fl d Ar domain
175 Specify what domain to use when changing an NIS password.
176 By default,
177 .Nm
178 assumes that the system default domain should be used.
179 This flag is
180 primarily for use by the superuser on the NIS master server: a single
181 NIS server can support multiple domains.
182 It is also possible that the
183 domainname on the NIS master may not be set (it is not necessary for
184 an NIS server to also be a client) in which case the
185 .Nm
186 command needs to be told what domain to operate on.
187 .It Fl h Ar host
188 Specify the name of an NIS server.
189 This option, in conjunction
190 with the
191 .Fl d
192 option, can be used to change an NIS password on a non-local NIS
193 server.
194 When a domain is specified with the
195 .Fl d
196 option and
197 .Nm
198 is unable to determine the name of the NIS master server (possibly because
199 the local domainname isn't set), the name of the NIS master is assumed to
200 be
201 .Dq localhost .
202 This can be overridden with the
203 .Fl h
204 flag.
205 The specified hostname need not be the name of an NIS master: the
206 name of the NIS master for a given map can be determined by querying any
207 NIS server (master or slave) in a domain, so specifying the name of a
208 slave server will work equally well.
209 .Pp
210 .It Fl o
211 Do not automatically override the password authentication checks for the
212 super-user on the NIS master server; assume 'old' mode instead.
213 This
214 flag is of limited practical use but is useful for testing.
215 .El
216 .Sh FILES
217 .Bl -tag -width /etc/master.passwd -compact
218 .It Pa /etc/master.passwd
219 The user database
220 .It Pa /etc/passwd
221 A Version 7 format password file
222 .It Pa /etc/passwd.XXXXXX
223 Temporary copy of the password file
224 .It Pa /etc/login.conf
225 Login class capabilities database
226 .It Pa /etc/auth.conf
227 configure authentication services
228 .El
229 .Sh SEE ALSO
230 .Xr chpass 1 ,
231 .Xr kerberos 1 ,
232 .Xr kinit 1 ,
233 .Xr login 1 ,
234 .Xr login.conf 5 ,
235 .Xr passwd 5 ,
236 .Xr kpasswdd 8 ,
237 .Xr pwd_mkdb 8 ,
238 .Xr vipw 8
239 .Rs
240 .%A Robert Morris
241 .%A Ken Thompson
242 .%T "UNIX password security"
243 .Re
244 .Sh NOTES
245 The
246 .Xr yppasswd 1
247 command is really only a link to
248 .Nm .
249 .Sh HISTORY
250 A
251 .Nm
252 command appeared in
253 .At v6 .