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