]> git.cameronkatri.com Git - apple_cmds.git/blob - remote_cmds/tftpd.tproj/tftpd.8
file_cmds: Fix compilation for lower targets
[apple_cmds.git] / remote_cmds / tftpd.tproj / tftpd.8
1 .\" $NetBSD: tftpd.8,v 1.21 2003/08/07 09:46:53 agc 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 June 11, 2003
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 d
43 .Op Fl g Ar group
44 .Op Fl i
45 .Op Fl l
46 .Op Fl n
47 .Op Fl s Ar directory
48 .Op Fl u Ar user
49 .Op Ar directory ...
50 .Sh DESCRIPTION
51 .Nm
52 is a server which supports the
53 .Tn DARPA
54 Trivial File Transfer Protocol.
55 The
56 .Tn TFTP
57 server operates at the port indicated in the
58 .Ql tftp
59 service description; see
60 .Xr services 5 .
61 This server should not be started manually; instead, it should be run using
62 .Xr launchd 8
63 using the plist
64 .Pa /System/Library/LaunchDaemons/tftp.plist .
65 It may be started using the
66 .Xr launchctl 1
67 load command; refer to the documentation for that utility for more information.
68 .Pp
69 The use of
70 .Xr tftp 1
71 does not require an account or password on the remote system.
72 Due to the lack of authentication information,
73 .Nm
74 will allow only publicly readable files to be accessed.
75 Filenames beginning in ``\|\fB.\|.\fP\|/'' or
76 containing ``/\|\fB.\|.\fP\|/'' are not allowed.
77 Files may be written to only if they already exist and are publicly writable.
78 .Pp
79 Note that this extends the concept of
80 .Qq public
81 to include
82 all users on all hosts that can be reached through the network;
83 this may not be appropriate on all systems, and its implications
84 should be considered before enabling tftp service.
85 The server should have the user ID with the lowest possible privilege.
86 .Pp
87 Access to files may be restricted by invoking
88 .Nm
89 with a list of directories by including up to 20 pathnames
90 as server program arguments in
91 .Pa /System/Library/LaunchDaemons/tftp.plist .
92 In this case access is restricted to files whose
93 names are prefixed by the one of the given directories.
94 The given directories are also treated as a search path for
95 relative filename requests.
96 .Pp
97 The options are:
98 .Bl -tag -width "directory"
99 .It Fl d
100 Enable verbose debugging messages to
101 .Xr syslogd 8 .
102 .It Fl g Ar group
103 Change gid to that of
104 .Ar group
105 on startup.
106 If this isn't specified, the gid is set to that of the
107 .Ar user
108 specified with
109 .Fl u .
110 .It Fl i
111 Enable insecure mode, no
112 .Xr realpath 3 .
113 .It Fl l
114 Logs all requests using
115 .Xr syslog 3 .
116 .It Fl n
117 Suppresses negative acknowledgement of requests for nonexistent
118 relative filenames.
119 .It Fl s Ar directory
120 .Nm
121 will
122 .Xr chroot 2
123 to
124 .Ar directory
125 on startup.
126 This is recommended for security reasons (so that files other than
127 those in the
128 .Pa /tftpboot
129 directory aren't accessible).
130 If the remote host passes the directory name as part of the
131 file name to transfer, you may have to create a symbolic link
132 from
133 .Sq tftpboot
134 to
135 .Sq \&.
136 under
137 .Pa /tftpboot .
138 .It Fl u Ar user
139 Change uid to that of
140 .Ar user
141 on startup.
142 If
143 .Fl u
144 isn't given,
145 .Ar user
146 defaults to
147 .Dq nobody .
148 If
149 .Fl g
150 isn't also given, change the gid to that of
151 .Ar user
152 as well.
153 .El
154 .Sh SEE ALSO
155 .Xr tftp 1 ,
156 .Xr launchd 8 ,
157 .Xr launchctl 1 ,
158 .Xr launchd.plist 5
159 .Rs
160 .%R RFC
161 .%N 1350
162 .%D July 1992
163 .%T "The TFTP Protocol (Revision 2)"
164 .Re
165 .Rs
166 .%R RFC
167 .%N 2347
168 .%D May 1998
169 .%T "TFTP Option Extension"
170 .Re
171 .Rs
172 .%R RFC
173 .%N 2348
174 .%D May 1998
175 .%T "TFTP Blocksize Option"
176 .Re
177 .Rs
178 .%R RFC
179 .%N 2349
180 .%D May 1998
181 .%T "TFTP Timeout Interval and Transfer Size Options"
182 .Re
183 .Sh HISTORY
184 The
185 .Nm
186 command appeared in
187 .Bx 4.2 .
188 .Pp
189 The
190 .Fl s
191 flag appeared in
192 .Nx 1.0 .
193 .Pp
194 The
195 .Fl g
196 and
197 .Fl u
198 flags appeared in
199 .Nx 1.4 .
200 .Pp
201 IPv6 support was implemented by WIDE/KAME project in 1999.
202 .Pp
203 TFTP options were implemented by Wasabi Systems, Inc., in 2003,
204 and first appeared in
205 NetBSD 2.0 .
206 .Sh BUGS
207 Files larger than 33488896 octets (65535 blocks) cannot be transferred
208 without client and server supporting blocksize negotiation (RFCs
209 2347 and 2348).
210 .Pp
211 Many tftp clients will not transfer files over 16744448 octets (32767 blocks).
212 .Sh SECURITY CONSIDERATIONS
213 You are
214 .Em strongly
215 advised to set up
216 .Nm
217 using the
218 .Fl s
219 flag in conjunction with the name of the directory that
220 contains the files that
221 .Nm
222 will serve to remote hosts (e.g.,
223 .Pa /tftpboot ) .
224 This ensures that only the files that should be served
225 to remote hosts can be accessed by them.
226 .Pp
227 Because there is no user-login or validation within
228 the
229 .Tn TFTP
230 protocol, the remote site will probably have some
231 sort of file-access restrictions in place.
232 The exact methods are specific to each site and therefore
233 difficult to document here.