Make the version number automatically included in the man page footer
[tftp-hpa.git] / tftpd / tftpd.8.in
blob6c8b72062e35f7bb32b481d00595c3caf5dbc842
1 .\" -*- nroff -*- --------------------------------------------------------- *
2 .\" $Id$
3 .\"  
4 .\" Copyright (c) 1990, 1993, 1994
5 .\"     The Regents of the University of California.  All rights reserved.
6 .\"
7 .\" Copyright 2001 H. Peter Anvin - All Rights Reserved
8 .\"
9 .\" Redistribution and use in source and binary forms, with or without
10 .\" modification, are permitted provided that the following conditions
11 .\" are met:
12 .\" 1. Redistributions of source code must retain the above copyright
13 .\"    notice, this list of conditions and the following disclaimer.
14 .\" 2. Redistributions in binary form must reproduce the above copyright
15 .\"    notice, this list of conditions and the following disclaimer in the
16 .\"    documentation and/or other materials provided with the distribution.
17 .\" 3. Neither the name of the University nor the names of its contributors
18 .\"    may be used to endorse or promote products derived from this software
19 .\"    without specific prior written permission.
20 .\"
21 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
22 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24 .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
25 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 .\" SUCH DAMAGE.
32 .\"
33 .\"----------------------------------------------------------------------- */
34 .TH TFTPD 8 "16 November 2001" "tftp-hpa @@VERSION@@" "UNIX System Manager's Manual"
35 .SH NAME
36 .B tftpd
37 \- IPv4 Trivial File Transfer Protocol server
38 .SH SYNOPSIS
39 .B in.tftpd
40 .RI [ options... ]
41 .I directory...
42 .SH DESCRIPTION
43 .B tftpd
44 is a server for the IPv4 Trivial File Transfer Protocol.  The TFTP
45 protocol is extensively used to support remote booting of diskless
46 devices.  The server is normally started by
47 .BR inetd ,
48 but can also run standalone.
49 .PP
50 .SH OPTIONS
51 .TP
52 .B \-l
53 Run the server in standalone (listen) mode, rather than run from
54 .BR inetd .
55 In listen mode, the
56 .B \-t
57 option is ignored, and the
58 .B \-a
59 option can be used to specify a specific local address or port to
60 listen to.
61 .TP
62 \fB\-a\fP \fI[address][:port]\fP
63 Specify a specific
64 .I address
65 and
66 .I port
67 to listen to when called with the
68 .B \-l
69 option.  The default is to listen to the
70 .I tftp
71 port specified in
72 .I /etc/services
73 on all local addresses.
74 .TP
75 .B \-c
76 Allow new files to be created.  By default,
77 .B tftpd
78 will only allow upload of files that already exist.  Files are created
79 with default permissions allowing anyone to read or write them.
80 .TP
81 .B \-s
82 Change root directory on startup.  This means the remote host does not
83 need to pass along the directory as part of the transfer, and may add
84 security.  When
85 .B \-s
86 is specified, exactly one
87 .I directory
88 should be specified on the command line.  The use of this option is
89 recommended for security as well as compatibility with some boot ROMs
90 which cannot be easily made to include a directory name in its request.
91 .TP
92 \fB\-u\fP \fIusername\fP
93 Specify the username which
94 .B tftpd
95 will run as; the default is "nobody".
96 .TP
97 \fB\-t\fP \fItimeout\fP
98 When run from
99 .B inetd
100 this specifies how long, in seconds, to wait for a second connection
101 before terminating the server.
102 .B inetd
103 will then respawn the server when another request comes in.  The
104 default is 900 (15 minutes.)
106 \fB\-m\fP \fIremap-file\fP
107 Specify the use of filename remapping.  The
108 .I remap-file
109 is a file containing the remapping rules.  See the section on filename
110 remapping below.  This option may not be compiled in, see the output of
111 .B "in.tftpd \-V"
112 to verify whether or not it is available.
114 .B \-v
115 Increase the logging verbosity of
116 .BR tftpd .
117 This flag can be specified multiple times for even higher verbosity.
119 \fB\-r\fP \fItftp-option\fP
120 Indicate that a specific RFC 2347 TFTP option should never be
121 accepted.
123 .B \-V
124 Print the version number and configuration to standard output, then
125 exit gracefully.
126 .SH "RFC 2347 OPTION NEGOTIATION"
127 This version of
128 .B tftpd
129 supports RFC 2347 option negotation.  Currently implemented options
131 .B blksize
132 (RFC 2348),
133 .B blksize2
134 (nonstandard),
135 .B tsize
136 (RFC 2349), and
137 .B timeout
138 (RFC 2349).  The nonstandard
139 .B blksize2
140 TFTP option is functionally identical to the
141 .B blksize
142 option, with the additional constraint that the
143 blocksize is constrained to be a power of 2.
146 .B \-r
147 option can be used to disable specific options; this may be necessary
148 to work around bugs in specific TFTP client implementations.
149 .SH "FILENAME REMAPPING"
151 .B \-m
152 option specifies a file which contains filename remapping rules.  Each
153 non-comment line (comments begin with hash marks,
154 .BR # )
155 contains an
156 .IR operation ,
157 specified below; a
158 .IR regex ,
159 a regular expression in the style of
160 .BR egrep ;
161 and optionally a
162 .IR "replacement pattern" .
163 The operation indicated by
164 .I operation
165 is performed if the
166 .I regex
167 matches all or part of the filename.  Rules are processed from the top
168 down, and by default, all rules are processed even if there is a
169 match.
172 .I operation
173 can be any combination of the following letters:
175 .B r
176 Replace the substring matched by
177 .I regex
178 by the
179 .IR "replacement pattern" .
180 The replacement pattern may contain escape sequences; see below.
182 .B g
183 Repeat this rule until it no longer matches.  This is always used with
184 .BR r .
186 .B i
187 Match the
188 .I regex
189 case-insensitively.  By default it is case sensitive.
191 .B e
192 If this rule matches, end rule processing after executing the rule.
194 .B s
195 If this rule matches, start rule processing over from the very first
196 rule after executing this rule.
198 .B a
199 If this rule matches, refuse the request and send an access denied
200 error to the client.
202 .B G
203 This rule applies to GET (RRQ) requests only.
205 .B P
206 This rule applies to PUT (WRQ) requests only.
208 The following escape sequences are recognized as part of the
209 .IR "replacement pattern" :
211 \fB\\0\fP
212 The entire string matched by the
213 .IR regex .
215 \fB\\1\fP to \fB\\9\fP
216 Match the first nine parentensized subexpressions, \\( ... \\) of the
217 .I regex
218 pattern.
220 \fB\\i\fP
221 The IP address of the requesting host, in dotted-quad notation
222 (e.g. 192.0.2.169).
224 \fB\\x\fP
225 The IP address of the requesting host, in hexadecimal notation
226 (e.g. C00002A9).
228 \fB\\\fP
229 Literal backslash.
231 \fB\\\fP\fIwhitespace\fP
232 Literal whitespace.
234 \fB\\#\fI
235 Literal hash mark.
237 If the mapping file is changed, you need to send
238 .B SIGHUP
239 to any outstanding
240 .B tftpd
241 process.
242 .SH "SECURITY"
243 The use of TFTP services does not require an account or password on
244 the server system.  Due to the lack of authentication information,
245 .B tftpd
246 will allow only publicly readable files (o+r) to be accessed.  Files
247 may be written only if they already exist and are publicly writable,
248 unless the
249 .B \-c
250 option is specified.  Note that this extends the concept of ``public''
251 to include all users on all hosts that can be reached through the
252 network; this may not be appropriate on all systems, and its
253 implications should be considered before enabling TFTP service.
254 Typically, some kind of firewall or packet-filter solution should be
255 employed.  If appropriately compiled (see the output of
256 .BR  "in.tftpd \-V" )
257 .B tftpd
258 will query the
259 .BR hosts_access (5)
260 database for access control information.  This may be slow; sites
261 requiring maximum performance may want to compile without this option
262 and rely on firewalling or kernel-based packet filters instead.
264 The server should be set to have the user ID with the lowest possible
265 privilege; please see the
266 .B \-u
267 flag.
269 Access to files can, and should, be restricted by invoking
270 .B tftpd
271 with a list of directories by including pathnames as server program
272 arguments on the command line.  In this case access is restricted to
273 files whole names are prefixed by one of the given directories.  If
274 possible, it is recommended that the
275 .B \-s
276 flag is used to set up a chroot() environment for the server to run in
277 once a connection has been set up.
279 Finally, the filename remapping
280 .RB ( \-m
281 flag) support can be used to provide a limited amount of additional
282 access control.
283 .SH "CONFORMING TO"
284 RFC 1123,
285 .IR "Requirements for Internet Hosts \- Application and Support" .
287 RFC 1350,
288 .IR "The TFTP Protocol (revision 2)" .
290 RFC 2347,
291 .IR "TFTP Option Extension" .
293 RFC 2348,
294 .IR "TFTP Blocksize Option" .
296 RFC 2349,
297 .IR "TFTP Timeout Interval and Transfer Size Options" .
298 .SH "AUTHOR"
299 This version of
300 .B tftpd
301 is maintained by H. Peter Anvin <hpa@zytor.com>.  It was derived from,
302 but has substantially diverged from, an OpenBSD source base, with
303 added patches by Markus Gutschke and Gero Kulhman.
304 .SH "SEE ALSO"
305 .BR tftp (1),
306 .BR egrep (1),
307 .BR hosts_access (5),
308 .BR regex (7),
309 .BR inetd (8).