Merge branch 'vendor/DIALOG'
[dragonfly.git] / usr.sbin / rpc.yppasswdd / rpc.yppasswdd.8
1 .\" Copyright (c) 1995, 1996
2 .\"     Bill Paul <wpaul@ctr.columbia.edu>.  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 Bill Paul.
15 .\" 4. Neither the name of the author nor the names of contributors
16 .\"    may be used to endorse or promote products derived from this software
17 .\"    without specific prior written permission.
18 .\"
19 .\" THIS SOFTWARE IS PROVIDED BY Bill Paul AND CONTRIBUTORS ``AS IS'' AND
20 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22 .\" ARE DISCLAIMED.  IN NO EVENT SHALL Bill Paul OR CONTRIBUTORS BE LIABLE
23 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
25 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29 .\" SUCH DAMAGE.
30 .\"
31 .\" $FreeBSD: src/usr.sbin/rpc.yppasswdd/rpc.yppasswdd.8,v 1.25 2005/02/13 23:45:53 ru Exp $
32 .\"
33 .Dd February 8, 1996
34 .Dt RPC.YPPASSWDD 8
35 .Os
36 .Sh NAME
37 .Nm rpc.yppasswdd
38 .Nd "server for updating NIS passwords"
39 .Sh SYNOPSIS
40 .Nm
41 .Op Fl t Ar master.passwd template file
42 .Op Fl d Ar default domain
43 .Op Fl p Ar path
44 .Op Fl s
45 .Op Fl f
46 .Op Fl a
47 .Op Fl m
48 .Op Fl i
49 .Op Fl v
50 .Op Fl u
51 .Op Fl h
52 .Sh DESCRIPTION
53 The
54 .Nm
55 utility allows users to change their NIS passwords and certain
56 other information using the
57 .Xr yppasswd 1
58 and
59 .Xr ypchpass 1
60 commands.
61 The
62 .Nm
63 utility
64 is an RPC-based server that accepts incoming password change requests,
65 authenticates them, places the updated information in the
66 .Pa /var/yp/master.passwd
67 template file and then updates the NIS
68 .Pa master.passwd
69 and
70 .Pa passwd
71 maps.
72 .Pp
73 The
74 .Nm
75 utility allows a normal NIS user to change
76 his or her NIS password, full name (also
77 known as 'GECOS' field) or shell.
78 These updates are typically done using
79 the
80 .Xr yppasswd 1 ,
81 .Xr ypchfn 1 ,
82 .Xr ypchsh 1 ,
83 or
84 .Xr ypchpass 1
85 commands.
86 (Some administrators do not want users to be able to change their
87 full name information or shells; the server can be invoked with option flags
88 that disallow such changes.)
89 When the server receives an update request,
90 it compares the address of the client making the request against the
91 .Pa securenets
92 rules outlined in
93 .Pa /var/yp/securenets .
94 (See the
95 .Xr ypserv 8
96 manual page for more information on securenets; the
97 .Nm
98 utility uses the same access control mechanism as
99 .Xr ypserv 8 . )
100 .Pp
101 The server then
102 checks the 'old' password supplied by the user to make sure it is
103 valid, then performs some sanity checks on the updated information (these
104 include checking for embedded control characters, colons or invalid shells).
105 Once it is satisfied that the update request is valid, the server modifies
106 the template password file (the default is
107 .Pa /var/yp/master.passwd )
108 and then runs the
109 .Pa /usr/libexec/yppwupdate
110 script to rebuild the NIS maps.
111 (This script has two arguments passed
112 to it: the absolute pathname of the password template that was modified
113 and the name of the domain that is to be updated.
114 These in turn are
115 passed to
116 .Pa /var/yp/Makefile ) .
117 .Pp
118 The
119 .Dx
120 version of
121 .Nm
122 also allows the super-user on the NIS master server to perform more
123 sophisticated updates on the NIS passwd maps.
124 The super-user can modify
125 any field in any user's master.passwd entry in any domain, and can
126 do so without knowing the user's existing NIS password (when the server
127 receives a request from the super-user, the password authentication
128 check is bypassed).
129 Furthermore, if the server is invoked with the
130 .Fl a
131 flag, the super-user can even add new entries to the maps using
132 .Xr ypchpass 1 .
133 Again, this only applies to the super-user on the NIS
134 master server: none of these special functions can be performed over
135 the network.
136 .Pp
137 The
138 .Nm
139 utility can only be run on a machine that is an NIS master server.
140 .Sh OPTIONS
141 The following options are available:
142 .Bl -tag -width indent
143 .It Fl t Ar master.passwd template file
144 By default,
145 .Nm
146 assumes that the template file used to generates the
147 .Pa master.passwd
148 and
149 .Pa passwd
150 maps for the default domain is called
151 .Pa /var/yp/master.passwd .
152 This default can be overridden by specifying an alternate file name
153 with the
154 .Fl t
155 flag.
156 .Pp
157 Note: if the template file specified with this flag is
158 .Pa /etc/master.passwd ,
159 .Nm
160 will also automatically invoke
161 .Xr pwd_mkdb 8
162 to rebuild the local password databases in addition to the NIS
163 maps.
164 .It Fl d Ar domain
165 The
166 .Nm
167 utility can support multiple domains, however it must
168 choose one domain as a default.
169 It will try to use the system default domain name as set by the
170 .Xr domainname 1
171 command for this default.
172 However,
173 if the system domain name is not
174 set, a default domain must be specified on
175 the command line.
176 If the system default domain is set,
177 then this option can be used to override it.
178 .It Fl p Ar path
179 This option can be used to override the default path to
180 the location of the NIS
181 map databases.
182 The compiled-in default path is
183 .Pa /var/yp .
184 .It Fl s
185 Disallow changing of shell information.
186 .It Fl f
187 Disallow changing of full name ('GECOS') information.
188 .It Fl a
189 Allow additions to be made to the NIS passwd databases.
190 The super-user on the
191 NIS master server is permitted to use the
192 .Xr ypchpass 1
193 command to perform unrestricted modifications to any field in a user's
194 .Pa master.passwd
195 map entry.
196 When
197 .Nm
198 is started with this flag, it will also allow the super-user to add new
199 records to the NIS passwd maps, just as is possible when using
200 .Xr chpass 1
201 to modify the local password database.
202 .It Fl m
203 Turn on multi-domain mode.
204 Even though
205 .Xr ypserv 8
206 can handle several simultaneous domains, most implementations of
207 .Nm
208 can only operate on a single NIS domain, which is generally the same as
209 the system default domain of the NIS master server.
210 The
211 .Dx
212 .Nm
213 attempts to overcome this problem in spite of the inherent limitations
214 of the
215 .Pa yppasswd
216 protocol, which does not allow for a
217 .Pa domain
218 argument in client requests.
219 In multi-domain mode,
220 .Nm
221 will search through all the passwd maps of all the domains it
222 can find under
223 .Pa /var/yp
224 until it finds an entry that matches the user information specified in
225 a given update request.
226 (Matches are determined by checking the username,
227 UID and GID fields.)
228 The matched entry and corresponding domain are then
229 used for the update.
230 .Pp
231 Note that in order for multi-domain mode to work, there have to be
232 separate template files for each domain.
233 For example, if a server
234 supports three domains,
235 .Pa foo ,
236 .Pa bar ,
237 and
238 .Pa baz ,
239 there should be three separate master.passwd template files called
240 .Pa /var/yp/foo/master.passwd ,
241 .Pa /var/yp/bar/master.passwd ,
242 and
243 .Pa /var/yp/baz/master.passwd .
244 If
245 .Pa foo
246 happens to be the system default domain, then its template file can
247 be either
248 .Pa /var/yp/foo/master.passwd
249 or
250 .Pa /var/yp/master.passwd .
251 The server will check for the latter file first and then use the former
252 if it cannot find it.
253 .Pp
254 Multi-domain mode is off by default since it can fail if there are
255 duplicate or near-duplicate user entries in different domains.
256 The server
257 will abort an update request if it finds more than one user entry that
258 matches its search criteria.
259 Even so, paranoid administrators
260 may wish to leave multi-domain mode disabled.
261 .It Fl i
262 If
263 .Nm
264 is invoked with this flag, it will perform map updates in place.
265 This
266 means that instead of just modifying the password template file and
267 starting a map update, the server will modify the map databases
268 directly.
269 This is useful when the password maps are large: if, for
270 example, the password database has tens of thousands of entries, it
271 can take several minutes for a map update to complete.
272 Updating the
273 maps in place reduces this time to a few seconds.
274 .It Fl v
275 Turn on verbose logging mode.
276 The server normally only logs messages
277 using the
278 .Xr syslog 3
279 facility when it encounters an error condition, or when processing
280 updates for the super-user on the NIS master server.
281 Running the server
282 with the
283 .Fl v
284 flag will cause it to log informational messages for all updates.
285 .It Fl u
286 Many commercial
287 .Xr yppasswd 1
288 clients do not use a reserved port when sending requests to
289 .Nm .
290 This is either because the
291 .Xr yppasswd 1
292 program is not installed set-uid root, or because the RPC
293 implementation does not place any emphasis on binding to reserved
294 ports when establishing client connections for the super-user.
295 By default,
296 .Nm
297 expects to receive requests from clients using reserved ports; requests
298 received from non-privileged ports are rejected.
299 Unfortunately, this
300 behavior prevents any client systems that to not use privileged
301 ports from successfully submitting password updates.
302 Specifying
303 the
304 .Fl u
305 flag to
306 .Nm
307 disables the privileged port check so that it will work with
308 .Xr yppasswd 1
309 clients that do not use privileged ports.
310 This reduces security to
311 a certain small degree, but it might be necessary in cases where it
312 is not possible to change the client behavior.
313 .It Fl h
314 Display the list of flags and options understood by
315 .Nm .
316 .El
317 .Sh FILES
318 .Bl -tag -width Pa -compact
319 .It Pa /usr/libexec/yppwupdate
320 The script invoked by
321 .Nm
322 to update and push the NIS maps after
323 an update.
324 .It Pa /var/yp/master.passwd
325 The template password file for the default domain.
326 .It Pa /var/yp/[domainname]/[maps]
327 The NIS maps for a particular NIS domain.
328 .It Pa /var/yp/[domainname]/master.passwd
329 The template password file(s) for non-default domains
330 (used only in multi-domain mode).
331 .El
332 .Sh SEE ALSO
333 .Xr yp 8 ,
334 .Xr yppush 8 ,
335 .Xr ypserv 8 ,
336 .Xr ypxfr 8
337 .Sh AUTHORS
338 .An Bill Paul Aq Mt wpaul@ctr.columbia.edu
339 .Sh BUGS
340 As listed in the yppasswd.x protocol definition, the YPPASSWDPROC_UPDATE
341 procedure takes two arguments: a V7-style passwd structure containing
342 updated user information and the user's existing unencrypted (cleartext)
343 password.
344 Since
345 .Nm
346 is supposed to handle update requests from remote NIS client machines,
347 this means that
348 .Xr yppasswd 1
349 and similar client programs will in fact be transmitting users' cleartext
350 passwords over the network.
351 .Pp
352 This is not a problem for password updates since the plaintext password
353 sent with the update will no longer be valid once the new encrypted password
354 is put into place, but if the user is only updating his or her 'GECOS'
355 information or shell, then the cleartext password sent with the update
356 will still be valid once the update is completed.
357 If the network is
358 insecure, this cleartext password could be intercepted and used to
359 gain unauthorized access to the user's account.