xref: /openbsd/usr.sbin/tftpd/tftpd.8 (revision 264ca280)
1.\"   $OpenBSD: tftpd.8,v 1.5 2015/07/18 05:32:56 mcbride 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: July 18 2015 $
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
73.Nm tftpd
74always provides random data at the path
75.Pa /etc/random.seed ,
76and therefore this path will be ignored inside the
77.Ar directory .
78.Ox
79network bootloaders access this path to harvest entropy during
80kernel load.
81.Pp
82The options are as follows:
83.Bl -tag -width Ds
84.It Fl 4
85Forces
86.Nm
87to use IPv4 addresses only.
88.It Fl 6
89Forces
90.Nm
91to use IPv6 addresses only.
92.It Fl c
93Allow new files to be created;
94otherwise uploaded files must already exist.
95Files are created with default permissions
96allowing anyone to read or write to them.
97.It Fl d
98Do not daemonize.
99If this option is specified,
100.Nm
101will run in the foreground and log
102the client IP, type of request, and filename to stderr.
103.It Fl l Ar address
104Listen on the specified address.
105By default
106.Nm
107listens on wildcard addresses.
108.It Fl p Ar port
109Listen on the specified port.
110By default
111.Nm
112listens on the port indicated in the
113.Ql tftp
114service description; see
115.Xr services 5 .
116.It Fl r Ar socket
117Issue filename rewrite requests to the specified UNIX domain socket.
118.Nm
119will write lines in the format "IP OP filename", terminated by a newline,
120where IP is the client's IP address, and OP is one of "read" or "write".
121.Nm
122expects replies in the format "filename" terminated by a newline.
123All rewrite requests from the daemon must be answered
124(even if it is with the original filename)
125before the TFTP request will continue.
126By default
127.Nm
128does not use filename rewriting.
129.It Fl v
130Log the client IP, type of request, and filename.
131.It Ar directory
132.Xr chroot 2
133to
134.Ar directory
135on startup;
136the remote host is not expected to pass the directory
137as part of the file name to transfer.
138.El
139.Sh SEE ALSO
140.Xr tftp 1 ,
141.Xr pxeboot 8 ,
142.Xr syslogd 8 ,
143.Xr tftp-proxy 8
144.Sh HISTORY
145The
146.Nm
147command was originally a process run via
148.Xr inetd 8
149and appeared in
150.Bx 4.2 .
151It was rewritten for
152.Ox 5.2
153as a persistent non-blocking daemon.
154.Sh BUGS
155Many TFTP clients will not transfer files over 16744448 octets
156.Pq 32767 blocks .
157