Sort options in SYNOPSIS.
[netbsd-mini2440.git] / libexec / tftpd / tftpd.8
bloba64a57abf53a5d01f2d10cd75947020c13e9a3a4
1 .\"     $NetBSD: tftpd.8,v 1.22 2010/01/08 21:05:14 christos Exp $
2 .\"
3 .\" Copyright (c) 1983, 1991, 1993
4 .\"     The Regents of the University of California.  All rights reserved.
5 .\"
6 .\" Redistribution and use in source and binary forms, with or without
7 .\" modification, are permitted provided that the following conditions
8 .\" are met:
9 .\" 1. Redistributions of source code must retain the above copyright
10 .\"    notice, this list of conditions and the following disclaimer.
11 .\" 2. Redistributions in binary form must reproduce the above copyright
12 .\"    notice, this list of conditions and the following disclaimer in the
13 .\"    documentation and/or other materials provided with the distribution.
14 .\" 3. Neither the name of the University nor the names of its contributors
15 .\"    may be used to endorse or promote products derived from this software
16 .\"    without specific prior written permission.
17 .\"
18 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
19 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
22 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
24 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28 .\" SUCH DAMAGE.
29 .\"
30 .\"     from: @(#)tftpd.8       8.1 (Berkeley) 6/4/93
31 .\"
32 .Dd January 8, 2010
33 .Dt TFTPD 8
34 .Os
35 .Sh NAME
36 .Nm tftpd
37 .Nd
38 .Tn DARPA
39 Internet Trivial File Transfer Protocol server
40 .Sh SYNOPSIS
41 .Nm
42 .Op Fl dln
43 .Op Fl g Ar group
44 .Op Fl p Ar path separator
45 .Op Fl s Ar directory
46 .Op Fl u Ar user
47 .Op Ar directory ...
48 .Sh DESCRIPTION
49 .Nm
50 is a server which supports the
51 .Tn DARPA
52 Trivial File Transfer Protocol.
53 The
54 .Tn TFTP
55 server operates at the port indicated in the
56 .Ql tftp
57 service description; see
58 .Xr services 5 .
59 The server is normally started by
60 .Xr inetd 8 .
61 .Pp
62 The use of
63 .Xr tftp 1
64 does not require an account or password on the remote system.
65 Due to the lack of authentication information,
66 .Nm
67 will allow only publicly readable files to be accessed.
68 Filenames beginning in
69 .Dq Pa ../
70 or containing
71 .Dq Pa /../
72 are not allowed.
73 Files may be written to only if they already exist and are publicly writable.
74 .Pp
75 Note that this extends the concept of
76 .Qq public
77 to include
78 all users on all hosts that can be reached through the network;
79 this may not be appropriate on all systems, and its implications
80 should be considered before enabling tftp service.
81 The server should have the user ID with the lowest possible privilege.
82 .Pp
83 Access to files may be restricted by invoking
84 .Nm
85 with a list of directories by including up to 20 pathnames
86 as server program arguments in
87 .Pa /etc/inetd.conf .
88 In this case access is restricted to files whose
89 names are prefixed by the one of the given directories.
90 The given directories are also treated as a search path for
91 relative filename requests.
92 .Pp
93 The options are:
94 .Bl -tag -width "directory"
95 .It Fl d
96 Enable verbose debugging messages to
97 .Xr syslogd 8 .
98 .It Fl g Ar group
99 Change gid to that of
100 .Ar group
101 on startup.
102 If this isn't specified, the gid is set to that of the
103 .Ar user
104 specified with
105 .Fl u .
106 .It Fl l
107 Logs all requests using
108 .Xr syslog 3 .
109 .It Fl n
110 Suppresses negative acknowledgement of requests for nonexistent
111 relative filenames.
112 .It Fl p Ar path separator
113 All occurances of the single character
114 .Ar path separator
115 in the requested filename are replaced with
116 .Sq / .
117 .It Fl s Ar directory
119 will
120 .Xr chroot 2
122 .Ar directory
123 on startup.
124 This is recommended for security reasons (so that files other than
125 those in the
126 .Pa /tftpboot
127 directory aren't accessible).
128 If the remote host passes the directory name as part of the
129 file name to transfer, you may have to create a symbolic link
130 from
131 .Sq tftpboot
133 .Sq \&.
134 under
135 .Pa /tftpboot .
136 .It Fl u Ar user
137 Change uid to that of
138 .Ar user
139 on startup.
141 .Fl u
142 isn't given,
143 .Ar user
144 defaults to
145 .Dq nobody .
147 .Fl g
148 isn't also given, change the gid to that of
149 .Ar user
150 as well.
152 .Sh SEE ALSO
153 .Xr tftp 1 ,
154 .Xr inetd 8
156 .%R RFC
157 .%N 1350
158 .%D July 1992
159 .%T "The TFTP Protocol (Revision 2)"
162 .%R RFC
163 .%N 2347
164 .%D May 1998
165 .%T "TFTP Option Extension"
168 .%R RFC
169 .%N 2348
170 .%D May 1998
171 .%T "TFTP Blocksize Option"
174 .%R RFC
175 .%N 2349
176 .%D May 1998
177 .%T "TFTP Timeout Interval and Transfer Size Options"
179 .Sh HISTORY
182 command appeared in
183 .Bx 4.2 .
186 .Fl s
187 flag appeared in
188 .Nx 1.0 .
191 .Fl g
193 .Fl u
194 flags appeared in
195 .Nx 1.4 .
197 IPv6 support was implemented by WIDE/KAME project in 1999.
199 TFTP options were implemented by Wasabi Systems, Inc., in 2003,
200 and first appeared in
201 .Nx 2.0 .
202 .Sh BUGS
203 Files larger than 33,553,919 octets (65535 blocks, last one less than 512
204 octets) cannot be correctly transferred without client and server
205 supporting blocksize negotiation (RFCs 2347 and 2348).
206 As a kludge,
208 accepts a sequence of block numbers which wrap to zero after 65535.
210 Many tftp clients will not transfer files over 16,776,703 octets
211 (32767 blocks), as they incorrectly count the block number using
212 a signed rather than unsigned 16-bit integer.
213 .Sh SECURITY CONSIDERATIONS
214 You are
215 .Em strongly
216 advised to set up
218 using the
219 .Fl s
220 flag in conjunction with the name of the directory that
221 contains the files that
223 will serve to remote hosts (e.g.,
224 .Pa /tftpboot ) .
225 This ensures that only the files that should be served
226 to remote hosts can be accessed by them.
228 Because there is no user-login or validation within
230 .Tn TFTP
231 protocol, the remote site will probably have some
232 sort of file-access restrictions in place.
233 The exact methods are specific to each site and therefore
234 difficult to document here.