xref: /openbsd-src/usr.sbin/tftpd/tftpd.8 (revision 91f110e064cd7c194e59e019b83bb7496c1c84d4)
1.\"   $OpenBSD: tftpd.8,v 1.4 2012/03/04 07:26:51 jmc Exp $
2.\"
3.\" Copyright (c) 1983, 1991 The Regents of the University of California.
4.\" 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	6.7 (Berkeley) 5/13/91
31.\"
32.Dd $Mdocdate: March 4 2012 $
33.Dt TFTPD 8
34.Os
35.Sh NAME
36.Nm tftpd
37.Nd DARPA Trivial File Transfer Protocol daemon
38.Sh SYNOPSIS
39.Nm tftpd
40.Op Fl 46cdv
41.Op Fl l Ar address
42.Op Fl p Ar port
43.Op Fl r Ar socket
44.Ar directory
45.Sh DESCRIPTION
46.Nm
47is a server which implements the
48.Tn DARPA
49Trivial File Transfer Protocol.
50.Pp
51The use of
52.Xr tftp 1
53does not require an account or password on the remote system.
54Due to the lack of authentication information,
55.Nm
56will allow only publicly readable files to be accessed.
57Files may be written only if they already exist and are publicly writable,
58unless the
59.Fl c
60flag is specified
61.Pq see below .
62Note that this extends the concept of
63.Dq public
64to include
65all users on all hosts that can be reached through the network;
66this may not be appropriate on all systems, and its implications
67should be considered before enabling TFTP service.
68.Pp
69The server must be started as root, but will chroot to the
70.Ar directory
71specified on the command line and drop privileges to the _tftpd user.
72.Pp
73The options are as follows:
74.Bl -tag -width Ds
75.It Fl 4
76Forces
77.Nm
78to use IPv4 addresses only.
79.It Fl 6
80Forces
81.Nm
82to use IPv6 addresses only.
83.It Fl c
84Allow new files to be created;
85otherwise uploaded files must already exist.
86Files are created with default permissions
87allowing anyone to read or write to them.
88.It Fl d
89Do not daemonize.
90If this option is specified,
91.Nm
92will run in the foreground and log
93the client IP, type of request, and filename to stderr.
94.It Fl l Ar address
95Listen on the specified address.
96By default
97.Nm
98listens on wildcard addresses.
99.It Fl p Ar port
100Listen on the specified port.
101By default
102.Nm
103listens on the port indicated in the
104.Ql tftp
105service description; see
106.Xr services 5 .
107.It Fl r Ar socket
108Issue filename rewrite requests to the specified UNIX domain socket.
109.Nm
110will write lines in the format "IP OP filename", terminated by a newline,
111where IP is the client's IP address, and OP is one of "read" or "write".
112.Nm
113expects replies in the format "filename" terminated by a newline.
114All rewrite requests from the daemon must be answered
115(even if it is with the original filename)
116before the TFTP request will continue.
117By default
118.Nm
119does not use filename rewriting.
120.It Fl v
121Log the client IP, type of request, and filename.
122.It Ar directory
123.Xr chroot 2
124to
125.Ar directory
126on startup;
127the remote host is not expected to pass the directory
128as part of the file name to transfer.
129.El
130.Sh SEE ALSO
131.Xr tftp 1 ,
132.Xr pxeboot 8 ,
133.Xr syslogd 8 ,
134.Xr tftp-proxy 8
135.Sh HISTORY
136The
137.Nm
138command was originally a process run via
139.Xr inetd 8
140and appeared in
141.Bx 4.2 .
142It was rewritten for
143.Ox 5.2
144as a persistent non-blocking daemon.
145.Sh BUGS
146Many TFTP clients will not transfer files over 16744448 octets
147.Pq 32767 blocks .
148