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