]> git.cameronkatri.com Git - apple_cmds.git/blob - remote_cmds/tftp.tproj/tftp.1
file_cmds: Fix compilation for lower targets
[apple_cmds.git] / remote_cmds / tftp.tproj / tftp.1
1 .\" $NetBSD: tftp.1,v 1.18 2003/08/07 11:16:14 agc Exp $
2 .\"
3 .\" Copyright (c) 1990, 1993, 1994
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.
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 .\" @(#)tftp.1 8.2 (Berkeley) 4/18/94
31 .\" $FreeBSD: src/usr.bin/tftp/tftp.1,v 1.20 2007/11/07 07:56:57 ru Exp $
32 .\"
33 .Dd June 11, 2003
34 .Dt TFTP 1
35 .Os
36 .Sh NAME
37 .Nm tftp
38 .Nd "trivial file transfer program"
39 .Sh SYNOPSIS
40 .Nm
41 .Op Fl e
42 .Op Ar host
43 .Op Ar port
44 .Sh DESCRIPTION
45 The
46 .Nm
47 utility is the user interface to the Internet
48 .Tn TFTP
49 (Trivial File Transfer Protocol),
50 which allows users to transfer files to and from a remote machine.
51 The remote
52 .Ar host
53 (and optional
54 .Ar port )
55 may be specified on the command line, in which case
56 .Nm
57 uses
58 .Ar host
59 (and
60 .Ar port )
61 as the default for future transfers (see the
62 .Cm connect
63 command below).
64 .Pp
65 The optional
66 .Fl e
67 argument sets a binary transfer mode as well as setting the extended options
68 as if
69 .Cm tout ,
70 .Cm tsize ,
71 and
72 .Cm blksize 65464 ,
73 had been given.
74 .Sh COMMANDS
75 Once
76 .Nm
77 is running, it issues the prompt
78 .Ql tftp\*[Gt]
79 and recognizes the following commands:
80 .Pp
81 .Bl -tag -width verbose -compact
82 .It Cm \&? Ar command-name ...
83 Print help information.
84 .Pp
85 .It Cm ascii
86 Shorthand for
87 .Ic mode Cm ascii .
88 .Pp
89 .It Cm binary
90 Shorthand for
91 .Ic mode Cm binary .
92 .Pp
93 .It Cm blksize Ar blk-size
94 Set the tftp blksize option to
95 .Ar blk-size
96 octets (8-bit bytes). Since the number of blocks in a tftp
97 .Cm get
98 or
99 .Cm put
100 is 65535, the default block size of 512 bytes only allows a maximum of
101 just under 32 megabytes to be transferred. The value given for
102 .Ar blk-size
103 must be between 8 and 65464, inclusive.
104 Note that many servers will not respect this option.
105 .Pp
106 .It Cm connect Ar host-name Op Ar port
107 Set the
108 .Ar host
109 (and optionally
110 .Ar port )
111 for transfers.
112 Note that the
113 .Tn TFTP
114 protocol, unlike the
115 .Tn FTP
116 protocol,
117 does not maintain connections between transfers; thus, the
118 .Cm connect
119 command does not actually create a connection,
120 but merely remembers what host is to be used for transfers.
121 You do not have to use the
122 .Cm connect
123 command; the remote host can be specified as part of the
124 .Cm get
125 or
126 .Cm put
127 commands.
128 .Pp
129 .It Cm get Ar filename
130 .It Cm get Ar remotename localname
131 .It Cm get Ar file1 file2 ... fileN
132 Get one or more files from the remote host.
133 When using the
134 .Ar host
135 argument, the
136 .Ar host
137 will be used as default host for future transfers.
138 If
139 .Ar localname
140 is specified, the file is stored locally as
141 .Ar localname ,
142 otherwise the original filename is used.
143 Note that it is not possible to download two files at a time, only
144 one, three, or more than three files, at a time.
145 .Pp
146 To specify an IPv6 numeric address for a host, wrap it using square
147 brackets like
148 .Dq Li [3ffe:2900:e00c:ffee::1234] : Ns Ar file
149 to disambiguate the
150 colons used in the IPv6 address from the colon separating the host and
151 the filename.
152 .Pp
153 .It Cm mode Ar transfer-mode
154 Set the mode for transfers;
155 .Ar transfer-mode
156 may be one of
157 .Cm ascii
158 or
159 .Cm binary .
160 The default is
161 .Cm ascii .
162 .Pp
163 .It Cm put Ar file
164 .It Cm put Ar localfile remotefile
165 .It Cm put Ar file1 file2 ... fileN remote-directory
166 Put a file or set of files to the specified
167 remote file or directory.
168 The destination
169 can be in one of two forms:
170 a filename on the remote host, if the host has already been specified,
171 or a string of the form
172 .Ar hosts:filename
173 to specify both a host and filename at the same time.
174 If the latter form is used,
175 the hostname specified becomes the default for future transfers.
176 When
177 .Ar remotename
178 is specified, the file is stored remotely as
179 .Ar remotename ,
180 otherwise the original filename is used.
181 If the
182 .Ar remote-directory
183 argument is used, the remote host is assumed to be a
184 .Ux
185 machine.
186 To specify an IPv6 numeric address for a
187 .Ar host ,
188 see the example under the
189 .Cm get
190 command.
191 .Pp
192 .It Cm quit
193 Exit
194 .Nm .
195 An end of file also exits.
196 .Pp
197 .It Cm rexmt Ar retransmission-timeout
198 Set the per-packet retransmission timeout, in seconds.
199 .Pp
200 .It Cm status
201 Show current status.
202 .Pp
203 .It Cm timeout Ar total-transmission-timeout
204 Set the total transmission timeout, in seconds.
205 .Pp
206 .It Cm tout
207 Toggle the tftp "timeout" option. If enabled, the client will pass its
208 .Ar retransmission-timeout
209 to the server.
210 Note that many servers will not respect this option.
211 .Pp
212 .It Cm trace
213 Toggle packet tracing.
214 .Pp
215 .It Cm tsize
216 Toggle the tftp "tsize" option. If enabled, the client will pass and
217 request the filesize of a file at the beginning of a file transfer.
218 Note that many servers will not respect this option.
219 .Pp
220 .It Cm verbose
221 Toggle verbose mode.
222 .El
223 .Sh HISTORY
224 The
225 .Nm
226 command appeared in
227 .Bx 4.3 .
228 IPv6 support was implemented by WIDE/KAME project in 1999.
229 TFTP options were implemented by Wasabi Systems, Inc., in 2003,
230 and first appeared in
231 .Nx 2.0 .
232 .Sh SECURITY CONSIDERATIONS
233 Because there is no user-login or validation within
234 the
235 .Tn TFTP
236 protocol, the remote site will probably have some
237 sort of file-access restrictions in place.
238 The
239 exact methods are specific to each site and therefore
240 difficult to document here.
241 .Pp
242 Files larger than 33488896 octets (65535 blocks) cannot be transferred
243 without client and server supporting blocksize negotiation (RFC1783).