xref: /openbsd/usr.bin/tftp/tftp.1 (revision d415bd75)
1.\"	$OpenBSD: tftp.1,v 1.21 2022/10/04 08:03:26 kn Exp $
2.\"	$NetBSD: tftp.1,v 1.5 1995/08/18 14:45:44 pk Exp $
3.\"
4.\" Copyright (c) 1990, 1993, 1994
5.\"	The Regents of the University of California.  All rights reserved.
6.\"
7.\" Redistribution and use in source and binary forms, with or without
8.\" modification, are permitted provided that the following conditions
9.\" are met:
10.\" 1. Redistributions of source code must retain the above copyright
11.\"    notice, this list of conditions and the following disclaimer.
12.\" 2. Redistributions in binary form must reproduce the above copyright
13.\"    notice, this list of conditions and the following disclaimer in the
14.\"    documentation and/or other materials provided with the distribution.
15.\" 3. Neither the name of the University nor the names of its contributors
16.\"    may be used to endorse or promote products derived from this software
17.\"    without specific prior written permission.
18.\"
19.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
20.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
23.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
25.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29.\" SUCH DAMAGE.
30.\"
31.\"     @(#)tftp.1	8.2 (Berkeley) 4/18/94
32.\"
33.Dd $Mdocdate: October 4 2022 $
34.Dt TFTP 1
35.Os
36.Sh NAME
37.Nm tftp
38.Nd trivial file transfer program
39.Sh SYNOPSIS
40.Nm tftp
41.Op Ar host Oo Ar port Oc
42.Sh DESCRIPTION
43.Nm
44is the user interface to the Internet
45.Tn TFTP
46(Trivial File Transfer Protocol),
47which allows users to transfer files to and from a remote machine.
48The remote
49.Ar host
50and
51.Ar port
52may be specified on the command line, in which case
53.Nm
54uses them as the default for future transfers (see the
55.Ic connect
56command below).
57.Sh COMMANDS
58Once
59.Nm
60is running, it issues the prompt
61.Ql tftp\*(Gt
62and recognizes the following commands:
63.Pp
64.Bl -tag -width verbose -compact
65.It Ic \&? Ns | Ns Ic help Op Ar command ...
66Print help information.
67.Pp
68.It Ic ascii
69Shorthand for
70.Ic mode Ar ascii .
71.Pp
72.It Ic binary
73Shorthand for
74.Ic mode Ar binary .
75.Pp
76.It Ic blksize Ar block-size
77Set the block size in bytes for one packet.
78The default value is 512 bytes.
79Valid values are 8 bytes \(en 65464 bytes.
80.Pp
81.It Ic connect Ar host Op Ar port
82Set the
83.Ar host
84(and optionally
85.Ar port )
86for transfers.
87Note that the
88.Tn TFTP
89protocol, unlike the
90.Tn FTP
91protocol,
92does not maintain connections between transfers; thus, the
93.Ic connect
94command does not actually create a connection,
95but merely remembers what host is to be used for transfers.
96You do not have to use the
97.Ic connect
98command; the remote host can be specified as part of the
99.Ic get
100or
101.Ic put
102commands.
103.Pp
104.It Xo
105.Ic get Oo Ar host : Oc Ns
106.Ar file Op Ar localname
107.Xc
108.It Xo
109.Ic get Oo Ar host1 : Oc Ns
110.Ar file1
111.Oo Ar host2 : Oc Ns
112.Ar file2 ...
113.Oo Ar hostN : Oc Ns
114.Ar fileN
115.Xc
116Get a file or set of files from the remote host.
117When using the
118.Ar host
119argument, the
120.Ar host
121will be used as the default host for future transfers.
122IPv6 addresses can be specified by enclosing
123.Ar host
124in square brackets.
125If
126.Ar localname
127is specified,
128the file is stored locally as
129.Ar localname ,
130otherwise the original filename is used.
131.Pp
132Note that it is not possible to download two files at the same time;
133only one, three, or more than three files
134can be downloaded at the same time.
135.Pp
136.It Ic mode Ar transfer-mode
137Set the mode for transfers;
138.Ar transfer-mode
139may be one of
140.Ar ascii
141or
142.Ar binary .
143The default is
144.Ar ascii .
145.Pp
146.It Xo
147.Ic put Ar file
148.Oo Oo Ar host : Oc Ns
149.Ar remotename Oc
150.Xc
151.It Xo
152.Ic put Ar file1 file2 ... fileN
153.Oo Oo Ar host : Oc Ns
154.Ar remote-directory Oc
155.Xc
156Put a file or set of files to the remote host.
157When using the
158.Ar host
159argument, the
160.Ar host
161will be used as the default host for future transfers.
162IPv6 addresses can be specified by enclosing
163.Ar host
164in square brackets.
165If
166.Ar remotename
167is specified, the file is stored remotely as
168.Ar remotename ,
169otherwise the original filename is used.
170If the
171.Ar remote-directory
172argument is used, the remote host is assumed to be a
173.Ux
174machine.
175.Pp
176Note that files may only be written to if they already exist on the
177remote host and are publicly writable.
178See
179.Xr tftpd 8
180for further details.
181.Pp
182.It Ic quit
183Exit
184.Nm .
185An end-of-file also exits.
186.Pp
187.It Ic rexmt Ar retransmission-timeout
188Set the per-packet retransmission timeout, in seconds.
189The default value is 5 seconds.
190Valid values are 1 second \(en 255 seconds.
191.Pp
192.It Ic status
193Show current status.
194.Pp
195.It Ic timeout Ar total-transmission-timeout
196Set the total transmission timeout, in seconds.
197The default value is 25 seconds.
198Valid values are 1 second \(en 255 seconds.
199.Pp
200.It Ic tout
201Toggle the
202.Ic tout
203option.
204This option delivers the retransmission timeout,
205which is set by
206.Ic rexmt ,
207to the server,
208so the server uses the same retransmission timeout as the client.
209.Pp
210.It Ic tsize
211Toggle the
212.Ic tsize
213option.
214This option delivers the total size of the file to be transferred.
215With this value given, the client or server can decide
216whether they are able to accept the file.
217.Pp
218.It Ic trace
219Toggle packet tracing.
220.Pp
221.It Ic verbose
222Toggle verbose mode.
223.El
224.Sh SEE ALSO
225.Xr ftp 1 ,
226.Xr tftp-proxy 8 ,
227.Xr tftpd 8
228.Sh HISTORY
229The
230.Nm
231command appeared in
232.Bx 4.3 .
233.Sh BUGS
234Because there is no user login or validation within
235the
236.Tn TFTP
237protocol, the remote site will probably have some
238sort of file access restrictions in place.
239The exact methods are specific to each site and therefore
240difficult to document here.
241