]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - usr.bin/tftp/tftp.1
Add ELF flag to disable ASLR stack gap.
[FreeBSD/FreeBSD.git] / usr.bin / tftp / tftp.1
1 .\" Copyright (c) 1990, 1993, 1994
2 .\"     The Regents of the University of California.  All rights reserved.
3 .\"
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
6 .\" are met:
7 .\" 1. Redistributions of source code must retain the above copyright
8 .\"    notice, this list of conditions and the following disclaimer.
9 .\" 2. Redistributions in binary form must reproduce the above copyright
10 .\"    notice, this list of conditions and the following disclaimer in the
11 .\"    documentation and/or other materials provided with the distribution.
12 .\" 3. Neither the name of the University nor the names of its contributors
13 .\"    may be used to endorse or promote products derived from this software
14 .\"    without specific prior written permission.
15 .\"
16 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
17 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
20 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26 .\" SUCH DAMAGE.
27 .\"
28 .\"     @(#)tftp.1      8.2 (Berkeley) 4/18/94
29 .\" $FreeBSD$
30 .\"
31 .Dd March 2, 2020
32 .Dt TFTP 1
33 .Os
34 .Sh NAME
35 .Nm tftp
36 .Nd trivial file transfer program
37 .Sh SYNOPSIS
38 .Nm
39 .Op Ar host Op Ar port
40 .Sh DESCRIPTION
41 The
42 .Nm
43 utility is the user interface to the Internet
44 .Tn TFTP
45 (Trivial File Transfer Protocol),
46 which allows users to transfer files to and from a remote machine.
47 The remote
48 .Ar host
49 may be specified on the command line, in which case
50 .Nm
51 uses
52 .Ar host
53 as the default host for future transfers (see the
54 .Cm connect
55 command below).
56 .Sh COMMANDS
57 Once
58 .Nm
59 is running, it issues the prompt
60 .Dq Li tftp>
61 and recognizes the following commands:
62 .Pp
63 .Bl -tag -width verbose -compact
64 .It Cm \&? Ar command-name ...
65 Print help information.
66 .Pp
67 .It Cm ascii
68 Shorthand for "mode ascii"
69 .Pp
70 .It Cm binary
71 Shorthand for "mode binary"
72 .Pp
73 .It Cm blocksize Ar [size]
74 Sets the TFTP blksize option in TFTP Read Request or Write Request packets
75 to
76 .Ar [size]
77 as specified in RFC 2348.
78 Valid values are between 8 and 65464.
79 If no blocksize is specified, then by default a blocksize of 512 bytes
80 will be used.
81 .Pp
82 .It Cm blocksize2 Ar [size]
83 Sets the TFTP blksize2 option in TFTP Read Request or Write Request packets
84 to
85 .Ar [size] .
86 Values are restricted to powers of 2 between 8 and 32768.
87 This is a non-standard TFTP option.
88 .Pp
89 .It Cm connect Ar host Op Ar port
90 Set the
91 .Ar host
92 (and optionally
93 .Ar port )
94 for transfers.
95 Note that the
96 .Tn TFTP
97 protocol, unlike the
98 .Tn FTP
99 protocol,
100 does not maintain connections between transfers; thus, the
101 .Cm connect
102 command does not actually create a connection,
103 but merely remembers what host is to be used for transfers.
104 You do not have to use the
105 .Cm connect
106 command; the remote host can be specified as part of the
107 .Cm get
108 or
109 .Cm put
110 commands.
111 .Pp
112 .It Cm debug Ar level
113 Enable or disable debugging levels during verbose output.
114 The value of
115 .Ar level
116 can be one of
117 .Cm packet , simple , options ,
118 or
119 .Cm access .
120 .Pp
121 .It Cm get Oo Ar host : Oc Ns Ar file Op Ar localname
122 .It Cm get Xo
123 .Oo Ar host1 : Oc Ns Ar file1
124 .Oo Ar host2 : Oc Ns Ar file2 ...
125 .Oo Ar hostN : Oc Ns Ar fileN
126 .Xc
127 Get one or more files from the remote host.
128 When using the
129 .Ar host
130 argument, the
131 .Ar host
132 will be used as default host for future transfers.
133 If
134 .Ar localname
135 is specified, the file is stored locally as
136 .Ar localname ,
137 otherwise the original filename is used.
138 Note that it is not possible to download two files at a time, only
139 one, three, or more than three files, at a time.
140 .Pp
141 To specify an IPv6 numeric address for a host, wrap it using square
142 brackets like
143 .Dq Li [3ffe:2900:e00c:ffee::1234] : Ns Ar file
144 to disambiguate the
145 colons used in the IPv6 address from the colon separating the host and
146 the filename.
147 .Pp
148 .It Cm mode Ar transfer-mode
149 Set the mode for transfers;
150 .Ar transfer-mode
151 may be one of
152 .Em ascii
153 or
154 .Em binary .
155 The default is
156 .Em binary .
157 .Pp
158 .It Cm packetdrop [arg]
159 Randomly drop
160 .Ar arg
161 out of 100 packets during a transfer.
162 This is a debugging feature.
163 .Pp
164 .It Cm put Ar file Op Oo Ar host : Oc Ns Ar remotename
165 .It Cm put Ar file1 file2 ... fileN Op Oo Ar host : Oc Ns Ar remote-directory
166 Put a file or set of files to the remote host.
167 When
168 .Ar remotename
169 is specified, the file is stored remotely as
170 .Ar remotename ,
171 otherwise the original filename is used.
172 If the
173 .Ar remote-directory
174 argument is used, the remote host is assumed to be a
175 .Ux
176 machine.
177 To specify an IPv6 numeric address for a
178 .Ar host ,
179 see the example under the
180 .Cm get
181 command.
182 .Pp
183 .It Cm options Ar [arg]
184 Enable or disable support for TFTP options.
185 The valid values of
186 .Ar arg
187 are
188 .Cm on
189 (enable RFC 2347 options),
190 .Cm off
191 (disable RFC 2347 options), and
192 .Cm extra
193 (toggle support for non-RFC defined options).
194 .Pp
195 .It Cm quit
196 Exit
197 .Nm .
198 An end of file also exits.
199 .Pp
200 .It Cm rexmt Ar retransmission-timeout
201 Set the per-packet retransmission timeout, in seconds.
202 .Pp
203 .It Cm rollover [arg]
204 Specify the rollover option in TFTP Read Request or Write
205 Request packets.
206 After 65535 packets have been transmitted, set the block counter to
207 .Ar arg .
208 Valid values of
209 .Ar arg
210 are 0 and 1.  This is a non-standard TFTP option.
211 .Pp
212 .It Cm status
213 Show current status.
214 .Pp
215 .It Cm timeout Ar total-transmission-timeout
216 Set the total transmission timeout, in seconds.
217 .Pp
218 .It Cm trace
219 Toggle packet tracing.
220 .Pp
221 .It Cm verbose
222 Toggle verbose mode.
223 .Pp
224 .It Cm windowsize Op Ar size
225 Sets the TFTP windowsize option in TFTP Read Request or Write Request packets to
226 .Op Ar size
227 blocks as specified in RFC 7440.
228 Valid values are between 1 and 65535.
229 If no windowsize is specified,
230 then the default windowsize of 1 block will be used.
231 .El
232 .Sh SEE ALSO
233 .Xr tftpd 8
234 .Pp
235 The following RFC's are supported:
236 .Rs
237 .%T RFC 1350: The TFTP Protocol (Revision 2)
238 .Re
239 .Rs
240 .%T RFC 2347: TFTP Option Extension
241 .Re
242 .Rs
243 .%T RFC 2348: TFTP Blocksize Option
244 .Re
245 .Rs
246 .%T RFC 2349: TFTP Timeout Interval and Transfer Size Options
247 .Re
248 .Rs
249 .%T RFC 3617: Uniform Resource Identifier (URI) Scheme and Applicability Statement for the Trivial File Transfer Protocol (TFTP)
250 .Re
251 .Rs
252 .%T RFC 7440: TFTP Windowsize Option
253 .Re
254 .Pp
255 The non-standard
256 .Cm rollover
257 and
258 .Cm blksize2
259 TFTP options are mentioned here:
260 .Rs
261 .%T Extending TFTP
262 .%U http://www.compuphase.com/tftp.htm
263 .Re
264 .Sh HISTORY
265 The
266 .Nm
267 command appeared in
268 .Bx 4.3 .
269 .Pp
270 Edwin Groothuis <edwin@FreeBSD.org> performed a major rewrite of the
271 .Xr tftpd 8
272 and
273 .Nm
274 code to support RFC2348.
275 .Sh NOTES
276 Because there is no user-login or validation within
277 the
278 .Tn TFTP
279 protocol, the remote site will probably have some
280 sort of file-access restrictions in place.
281 The
282 exact methods are specific to each site and therefore
283 difficult to document here.
284 .Pp
285 Files larger than 33488896 octets (65535 blocks) cannot be transferred
286 without client and server supporting the TFTP blocksize option (RFC2348),
287 or the non-standard TFTP rollover option.