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