xref: /freebsd/usr.bin/tftp/tftp.1 (revision bdcbfde31e8e9b343f113a1956384bdf30d1ed62)
1a2df389fSHajimu UMEMOTO.\" Copyright (c) 1990, 1993, 1994
29b50d902SRodney W. Grimes.\"	The Regents of the University of California.  All rights reserved.
39b50d902SRodney W. Grimes.\"
49b50d902SRodney W. Grimes.\" Redistribution and use in source and binary forms, with or without
59b50d902SRodney W. Grimes.\" modification, are permitted provided that the following conditions
69b50d902SRodney W. Grimes.\" are met:
79b50d902SRodney W. Grimes.\" 1. Redistributions of source code must retain the above copyright
89b50d902SRodney W. Grimes.\"    notice, this list of conditions and the following disclaimer.
99b50d902SRodney W. Grimes.\" 2. Redistributions in binary form must reproduce the above copyright
109b50d902SRodney W. Grimes.\"    notice, this list of conditions and the following disclaimer in the
119b50d902SRodney W. Grimes.\"    documentation and/or other materials provided with the distribution.
12fbbd9655SWarner Losh.\" 3. Neither the name of the University nor the names of its contributors
139b50d902SRodney W. Grimes.\"    may be used to endorse or promote products derived from this software
149b50d902SRodney W. Grimes.\"    without specific prior written permission.
159b50d902SRodney W. Grimes.\"
169b50d902SRodney W. Grimes.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
179b50d902SRodney W. Grimes.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
189b50d902SRodney W. Grimes.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
199b50d902SRodney W. Grimes.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
209b50d902SRodney W. Grimes.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
219b50d902SRodney W. Grimes.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
229b50d902SRodney W. Grimes.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
239b50d902SRodney W. Grimes.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
249b50d902SRodney W. Grimes.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
259b50d902SRodney W. Grimes.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
269b50d902SRodney W. Grimes.\" SUCH DAMAGE.
279b50d902SRodney W. Grimes.\"
28fdf929ffSJohn Baldwin.Dd March 2, 2020
299b50d902SRodney W. Grimes.Dt TFTP 1
3062500372SRuslan Ermilov.Os
319b50d902SRodney W. Grimes.Sh NAME
329b50d902SRodney W. Grimes.Nm tftp
33752fa694SWarner Losh.Nd trivial file transfer program
349b50d902SRodney W. Grimes.Sh SYNOPSIS
35fd129a02SPhilippe Charnier.Nm
36891ca8cfSSimon L. B. Nielsen.Op Ar host Op Ar port
379b50d902SRodney W. Grimes.Sh DESCRIPTION
38e8937ba0SPhilippe CharnierThe
39e8937ba0SPhilippe Charnier.Nm
40e8937ba0SPhilippe Charnierutility is the user interface to the Internet
419b50d902SRodney W. Grimes.Tn TFTP
429b50d902SRodney W. Grimes(Trivial File Transfer Protocol),
439b50d902SRodney W. Grimeswhich allows users to transfer files to and from a remote machine.
449b50d902SRodney W. GrimesThe remote
459b50d902SRodney W. Grimes.Ar host
469b50d902SRodney W. Grimesmay be specified on the command line, in which case
47fd129a02SPhilippe Charnier.Nm
489b50d902SRodney W. Grimesuses
499b50d902SRodney W. Grimes.Ar host
509b50d902SRodney W. Grimesas the default host for future transfers (see the
51752fa694SWarner Losh.Cm connect
529b50d902SRodney W. Grimescommand below).
539b50d902SRodney W. Grimes.Sh COMMANDS
549b50d902SRodney W. GrimesOnce
55fd129a02SPhilippe Charnier.Nm
569b50d902SRodney W. Grimesis running, it issues the prompt
57752fa694SWarner Losh.Dq Li tftp>
589b50d902SRodney W. Grimesand recognizes the following commands:
599b50d902SRodney W. Grimes.Pp
60752fa694SWarner Losh.Bl -tag -width verbose -compact
61752fa694SWarner Losh.It Cm \&? Ar command-name ...
629b50d902SRodney W. GrimesPrint help information.
639b50d902SRodney W. Grimes.Pp
64752fa694SWarner Losh.It Cm ascii
65752fa694SWarner LoshShorthand for "mode ascii"
669b50d902SRodney W. Grimes.Pp
67752fa694SWarner Losh.It Cm binary
68752fa694SWarner LoshShorthand for "mode binary"
699b50d902SRodney W. Grimes.Pp
70b68628c8SCraig Rodrigues.It Cm blocksize Ar [size]
71b68628c8SCraig RodriguesSets the TFTP blksize option in TFTP Read Request or Write Request packets
72b68628c8SCraig Rodriguesto
73b68628c8SCraig Rodrigues.Ar [size]
746d6d6c36SGordon Berglingas specified in RFC 2348.
756d6d6c36SGordon BerglingValid values are between 8 and 65464.
76b68628c8SCraig RodriguesIf no blocksize is specified, then by default a blocksize of 512 bytes
77b68628c8SCraig Rodrigueswill be used.
78b68628c8SCraig Rodrigues.Pp
79b68628c8SCraig Rodrigues.It Cm blocksize2 Ar [size]
80b68628c8SCraig RodriguesSets the TFTP blksize2 option in TFTP Read Request or Write Request packets
81b68628c8SCraig Rodriguesto
82b68628c8SCraig Rodrigues.Ar [size] .
836d6d6c36SGordon BerglingValues are restricted to powers of 2 between 8 and 32768.
846d6d6c36SGordon BerglingThis is a non-standard TFTP option.
85b68628c8SCraig Rodrigues.Pp
86752fa694SWarner Losh.It Cm connect Ar host Op Ar port
879b50d902SRodney W. GrimesSet the
889b50d902SRodney W. Grimes.Ar host
899b50d902SRodney W. Grimes(and optionally
909b50d902SRodney W. Grimes.Ar port )
919b50d902SRodney W. Grimesfor transfers.
929b50d902SRodney W. GrimesNote that the
939b50d902SRodney W. Grimes.Tn TFTP
949b50d902SRodney W. Grimesprotocol, unlike the
959b50d902SRodney W. Grimes.Tn FTP
969b50d902SRodney W. Grimesprotocol,
979b50d902SRodney W. Grimesdoes not maintain connections between transfers; thus, the
98752fa694SWarner Losh.Cm connect
999b50d902SRodney W. Grimescommand does not actually create a connection,
1009b50d902SRodney W. Grimesbut merely remembers what host is to be used for transfers.
1019b50d902SRodney W. GrimesYou do not have to use the
102752fa694SWarner Losh.Cm connect
1039b50d902SRodney W. Grimescommand; the remote host can be specified as part of the
104752fa694SWarner Losh.Cm get
1059b50d902SRodney W. Grimesor
106752fa694SWarner Losh.Cm put
1079b50d902SRodney W. Grimescommands.
1089b50d902SRodney W. Grimes.Pp
109b68628c8SCraig Rodrigues.It Cm debug Ar level
1106d6d6c36SGordon BerglingEnable or disable debugging levels during verbose output.
1116d6d6c36SGordon BerglingThe value of
112b68628c8SCraig Rodrigues.Ar level
113b68628c8SCraig Rodriguescan be one of
114b68628c8SCraig Rodrigues.Cm packet , simple , options ,
115b68628c8SCraig Rodriguesor
116b68628c8SCraig Rodrigues.Cm access .
117b68628c8SCraig Rodrigues.Pp
118752fa694SWarner Losh.It Cm get Oo Ar host : Oc Ns Ar file Op Ar localname
119752fa694SWarner Losh.It Cm get Xo
120d7b64526SSimon L. B. Nielsen.Oo Ar host1 : Oc Ns Ar file1
121d7b64526SSimon L. B. Nielsen.Oo Ar host2 : Oc Ns Ar file2 ...
122d7b64526SSimon L. B. Nielsen.Oo Ar hostN : Oc Ns Ar fileN
123d7b64526SSimon L. B. Nielsen.Xc
124d7b64526SSimon L. B. NielsenGet one or more files from the remote host.
125d7b64526SSimon L. B. NielsenWhen using the
126d7b64526SSimon L. B. Nielsen.Ar host
127d7b64526SSimon L. B. Nielsenargument, the
128d7b64526SSimon L. B. Nielsen.Ar host
129d7b64526SSimon L. B. Nielsenwill be used as default host for future transfers.
130d7b64526SSimon L. B. NielsenIf
131d7b64526SSimon L. B. Nielsen.Ar localname
132d7b64526SSimon L. B. Nielsenis specified, the file is stored locally as
133d7b64526SSimon L. B. Nielsen.Ar localname ,
134d7b64526SSimon L. B. Nielsenotherwise the original filename is used.
135d7b64526SSimon L. B. NielsenNote that it is not possible to download two files at a time, only
136d7b64526SSimon L. B. Nielsenone, three, or more than three files, at a time.
137d7b64526SSimon L. B. Nielsen.Pp
138d7b64526SSimon L. B. NielsenTo specify an IPv6 numeric address for a host, wrap it using square
139d7b64526SSimon L. B. Nielsenbrackets like
140d7b64526SSimon L. B. Nielsen.Dq Li [3ffe:2900:e00c:ffee::1234] : Ns Ar file
141d7b64526SSimon L. B. Nielsento disambiguate the
142d7b64526SSimon L. B. Nielsencolons used in the IPv6 address from the colon separating the host and
143d7b64526SSimon L. B. Nielsenthe filename.
1449b50d902SRodney W. Grimes.Pp
145752fa694SWarner Losh.It Cm mode Ar transfer-mode
1469b50d902SRodney W. GrimesSet the mode for transfers;
1479b50d902SRodney W. Grimes.Ar transfer-mode
1489b50d902SRodney W. Grimesmay be one of
149752fa694SWarner Losh.Em ascii
1509b50d902SRodney W. Grimesor
151752fa694SWarner Losh.Em binary .
1529b50d902SRodney W. GrimesThe default is
1537dbe228cSAlan Somers.Em binary .
1549b50d902SRodney W. Grimes.Pp
155b68628c8SCraig Rodrigues.It Cm packetdrop [arg]
156b68628c8SCraig RodriguesRandomly drop
157b68628c8SCraig Rodrigues.Ar arg
1586d6d6c36SGordon Berglingout of 100 packets during a transfer.
1596d6d6c36SGordon BerglingThis is a debugging feature.
160b68628c8SCraig Rodrigues.Pp
161752fa694SWarner Losh.It Cm put Ar file Op Oo Ar host : Oc Ns Ar remotename
162752fa694SWarner Losh.It Cm put Ar file1 file2 ... fileN Op Oo Ar host : Oc Ns Ar remote-directory
163d7b64526SSimon L. B. NielsenPut a file or set of files to the remote host.
164d7b64526SSimon L. B. NielsenWhen
165d7b64526SSimon L. B. Nielsen.Ar remotename
166d7b64526SSimon L. B. Nielsenis specified, the file is stored remotely as
167d7b64526SSimon L. B. Nielsen.Ar remotename ,
168d7b64526SSimon L. B. Nielsenotherwise the original filename is used.
169d7b64526SSimon L. B. NielsenIf the
170d7b64526SSimon L. B. Nielsen.Ar remote-directory
171d7b64526SSimon L. B. Nielsenargument is used, the remote host is assumed to be a
17206e482e6SRuslan Ermilov.Ux
1739b50d902SRodney W. Grimesmachine.
174d7b64526SSimon L. B. NielsenTo specify an IPv6 numeric address for a
175d7b64526SSimon L. B. Nielsen.Ar host ,
176d7b64526SSimon L. B. Nielsensee the example under the
177752fa694SWarner Losh.Cm get
178d7b64526SSimon L. B. Nielsencommand.
1799b50d902SRodney W. Grimes.Pp
180b68628c8SCraig Rodrigues.It Cm options Ar [arg]
1816d6d6c36SGordon BerglingEnable or disable support for TFTP options.
1826d6d6c36SGordon BerglingThe valid values of
183b68628c8SCraig Rodrigues.Ar arg
184b68628c8SCraig Rodriguesare
185b68628c8SCraig Rodrigues.Cm on
186b68628c8SCraig Rodrigues(enable RFC 2347 options),
187b68628c8SCraig Rodrigues.Cm off
188b68628c8SCraig Rodrigues(disable RFC 2347 options), and
189b68628c8SCraig Rodrigues.Cm extra
190b68628c8SCraig Rodrigues(toggle support for non-RFC defined options).
191b68628c8SCraig Rodrigues.Pp
192752fa694SWarner Losh.It Cm quit
1939b50d902SRodney W. GrimesExit
1948fe908efSRuslan Ermilov.Nm .
1959b50d902SRodney W. GrimesAn end of file also exits.
1969b50d902SRodney W. Grimes.Pp
197752fa694SWarner Losh.It Cm rexmt Ar retransmission-timeout
1989b50d902SRodney W. GrimesSet the per-packet retransmission timeout, in seconds.
1999b50d902SRodney W. Grimes.Pp
200b68628c8SCraig Rodrigues.It Cm rollover [arg]
201b68628c8SCraig RodriguesSpecify the rollover option in TFTP Read Request or Write
2026d6d6c36SGordon BerglingRequest packets.
2036d6d6c36SGordon BerglingAfter 65535 packets have been transmitted, set the block counter to
204b68628c8SCraig Rodrigues.Ar arg .
205b68628c8SCraig RodriguesValid values of
206b68628c8SCraig Rodrigues.Ar arg
207b68628c8SCraig Rodriguesare 0 and 1.  This is a non-standard TFTP option.
208b68628c8SCraig Rodrigues.Pp
209752fa694SWarner Losh.It Cm status
2109b50d902SRodney W. GrimesShow current status.
2119b50d902SRodney W. Grimes.Pp
212752fa694SWarner Losh.It Cm timeout Ar total-transmission-timeout
2139b50d902SRodney W. GrimesSet the total transmission timeout, in seconds.
2149b50d902SRodney W. Grimes.Pp
215752fa694SWarner Losh.It Cm trace
2169b50d902SRodney W. GrimesToggle packet tracing.
2179b50d902SRodney W. Grimes.Pp
218752fa694SWarner Losh.It Cm verbose
2199b50d902SRodney W. GrimesToggle verbose mode.
220fdf929ffSJohn Baldwin.Pp
221fdf929ffSJohn Baldwin.It Cm windowsize Op Ar size
222fdf929ffSJohn BaldwinSets the TFTP windowsize option in TFTP Read Request or Write Request packets to
223fdf929ffSJohn Baldwin.Op Ar size
224fdf929ffSJohn Baldwinblocks as specified in RFC 7440.
225fdf929ffSJohn BaldwinValid values are between 1 and 65535.
226fdf929ffSJohn BaldwinIf no windowsize is specified,
227fdf929ffSJohn Baldwinthen the default windowsize of 1 block will be used.
2289b50d902SRodney W. Grimes.El
229fcaab598SCraig Rodrigues.Sh SEE ALSO
230f6c506d9SCraig Rodrigues.Xr tftpd 8
231fcaab598SCraig Rodrigues.Pp
232fcaab598SCraig RodriguesThe following RFC's are supported:
233fcaab598SCraig Rodrigues.Rs
234fb9c3835SJoel Dahl.%T RFC 1350: The TFTP Protocol (Revision 2)
235fcaab598SCraig Rodrigues.Re
236fcaab598SCraig Rodrigues.Rs
237fb9c3835SJoel Dahl.%T RFC 2347: TFTP Option Extension
238fcaab598SCraig Rodrigues.Re
239fcaab598SCraig Rodrigues.Rs
240fb9c3835SJoel Dahl.%T RFC 2348: TFTP Blocksize Option
241fcaab598SCraig Rodrigues.Re
242fcaab598SCraig Rodrigues.Rs
243fb9c3835SJoel Dahl.%T RFC 2349: TFTP Timeout Interval and Transfer Size Options
244fcaab598SCraig Rodrigues.Re
245fcaab598SCraig Rodrigues.Rs
246fb9c3835SJoel Dahl.%T RFC 3617: Uniform Resource Identifier (URI) Scheme and Applicability Statement for the Trivial File Transfer Protocol (TFTP)
247fcaab598SCraig Rodrigues.Re
248fdf929ffSJohn Baldwin.Rs
249fdf929ffSJohn Baldwin.%T RFC 7440: TFTP Windowsize Option
250fdf929ffSJohn Baldwin.Re
251fcaab598SCraig Rodrigues.Pp
252fcaab598SCraig RodriguesThe non-standard
253fcaab598SCraig Rodrigues.Cm rollover
254fcaab598SCraig Rodriguesand
255fcaab598SCraig Rodrigues.Cm blksize2
256fcaab598SCraig RodriguesTFTP options are mentioned here:
257fcaab598SCraig Rodrigues.Rs
258fcaab598SCraig Rodrigues.%T Extending TFTP
259*1c7a40d2SWolfram Schneider.%U https://www.compuphase.com/tftp.htm
260fcaab598SCraig Rodrigues.Re
2616c7216dfSRuslan Ermilov.Sh HISTORY
2626c7216dfSRuslan ErmilovThe
2636c7216dfSRuslan Ermilov.Nm
2646c7216dfSRuslan Ermilovcommand appeared in
2656c7216dfSRuslan Ermilov.Bx 4.3 .
266f6c506d9SCraig Rodrigues.Pp
267f6c506d9SCraig RodriguesEdwin Groothuis <edwin@FreeBSD.org> performed a major rewrite of the
268f6c506d9SCraig Rodrigues.Xr tftpd 8
269f6c506d9SCraig Rodriguesand
270f6c506d9SCraig Rodrigues.Nm
271f6c506d9SCraig Rodriguescode to support RFC2348.
272e5660633SCraig Rodrigues.Sh NOTES
2739b50d902SRodney W. GrimesBecause there is no user-login or validation within
2749b50d902SRodney W. Grimesthe
2759b50d902SRodney W. Grimes.Tn TFTP
2769b50d902SRodney W. Grimesprotocol, the remote site will probably have some
2776a3e8b0aSRuslan Ermilovsort of file-access restrictions in place.
2786a3e8b0aSRuslan ErmilovThe
2799b50d902SRodney W. Grimesexact methods are specific to each site and therefore
2809b50d902SRodney W. Grimesdifficult to document here.
28167034ac6SJeroen Ruigrok van der Werven.Pp
28267034ac6SJeroen Ruigrok van der WervenFiles larger than 33488896 octets (65535 blocks) cannot be transferred
283e5660633SCraig Rodrigueswithout client and server supporting the TFTP blocksize option (RFC2348),
284e5660633SCraig Rodriguesor the non-standard TFTP rollover option.
285