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