1.\" $NetBSD: tftp.1,v 1.16 2003/06/11 01:44:32 briggs 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. All advertising materials mentioning features or use of this software 15.\" must display the following acknowledgement: 16.\" This product includes software developed by the University of 17.\" California, Berkeley and its contributors. 18.\" 4. Neither the name of the University nor the names of its contributors 19.\" may be used to endorse or promote products derived from this software 20.\" without specific prior written permission. 21.\" 22.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 23.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 24.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 25.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 26.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 27.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 28.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 29.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 30.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 31.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 32.\" SUCH DAMAGE. 33.\" 34.\" @(#)tftp.1 8.2 (Berkeley) 4/18/94 35.\" 36.Dd April 18, 1994 37.Dt TFTP 1 38.Os 39.Sh NAME 40.Nm tftp 41.Nd trivial file transfer program 42.Sh SYNOPSIS 43.Nm 44.Op Fl e 45.Op Ar host 46.Op Ar port 47.Sh DESCRIPTION 48.Nm 49is the user interface to the Internet 50.Tn TFTP 51(Trivial File Transfer Protocol), 52which allows users to transfer files to and from a remote machine. 53The remote 54.Ar host 55(and optional 56.Ar port ) 57may be specified on the command line, in which case 58.Nm 59uses 60.Ar host 61(and 62.Ar port ) 63as the default for future transfers (see the 64.Cm connect 65command below). 66.Pp 67The optional 68.Fl e 69argument sets a binary transfer mode as well as setting the extended options 70as if 71.Cm tout , 72.Cm tsize , 73and 74.Cm blksize 65464 , 75had been given. 76.Sh COMMANDS 77Once 78.Nm 79is running, it issues the prompt 80.Ql tftp\*[Gt] 81and recognizes the following commands: 82.Pp 83.Bl -tag -width verbose -compact 84.It Cm \&? Ar command-name ... 85Print help information. 86.Pp 87.It Cm ascii 88Shorthand for "mode ascii" 89.Pp 90.It Cm binary 91Shorthand for "mode binary" 92.Pp 93.It Cm blksize Ar blk-size 94Set the tftp blksize option to 95.Ar blk-size 96octets (8-bit bytes). Since the number of blocks in a tftp 97.Cm get 98or 99.Cm put 100is 65535, the default block size of 512 bytes only allows a maximum of 101just under 32 megabytes to be transferred. The value given for 102.Ar blk-size 103must be between 8 and 65464, inclusive. 104Note that many servers will not respect this option. 105.Pp 106.It Cm connect Ar host-name Op Ar port 107Set the 108.Ar host 109(and optionally 110.Ar port ) 111for transfers. 112Note that the 113.Tn TFTP 114protocol, unlike the 115.Tn FTP 116protocol, 117does not maintain connections between transfers; thus, the 118.Cm connect 119command does not actually create a connection, 120but merely remembers what host is to be used for transfers. 121You do not have to use the 122.Cm connect 123command; the remote host can be specified as part of the 124.Cm get 125or 126.Cm put 127commands. 128.Pp 129.It Cm get Ar filename 130.It Cm get Ar remotename localname 131.It Cm get Ar file1 file2 ... fileN 132Get a file or set of files from the specified 133.Ar sources . 134.Ar Source 135can be in one of two forms: 136a filename on the remote host, if the host has already been specified, 137or a string of the form 138.Ar hosts:filename 139to specify both a host and filename at the same time. 140If the latter form is used, 141the last hostname specified becomes the default for future transfers. 142.Pp 143.It Cm mode Ar transfer-mode 144Set the mode for transfers; 145.Ar transfer-mode 146may be one of 147.Em ascii 148or 149.Em binary . 150The default is 151.Em ascii . 152.Pp 153.It Cm put Ar file 154.It Cm put Ar localfile remotefile 155.It Cm put Ar file1 file2 ... fileN remote-directory 156Put a file or set of files to the specified 157remote file or directory. 158The destination 159can be in one of two forms: 160a filename on the remote host, if the host has already been specified, 161or a string of the form 162.Ar hosts:filename 163to specify both a host and filename at the same time. 164If the latter form is used, 165the hostname specified becomes the default for future transfers. 166If the remote-directory form is used, the remote host is 167assumed to be a 168.Ux 169machine. 170If you need to specify IPv6 numeric address to 171.Ar hosts , 172wrap them using square bracket like 173.Ar [hosts]:filename 174to disambiguate the colon. 175.Pp 176.It Cm quit 177Exit 178.Nm . 179An end of file also exits. 180.Pp 181.It Cm rexmt Ar retransmission-timeout 182Set the per-packet retransmission timeout, in seconds. 183.Pp 184.It Cm status 185Show current status. 186.Pp 187.It Cm timeout Ar total-transmission-timeout 188Set the total transmission timeout, in seconds. 189.Pp 190.It Cm tout 191Toggle the tftp "timeout" option. If enabled, the client will pass its 192.Ar retransmission-timeout 193to the server. 194Note that many servers will not respect this option. 195.Pp 196.It Cm trace 197Toggle packet tracing. 198.Pp 199.It Cm tsize 200Toggle the tftp "tsize" option. If enabled, the client will pass and 201request the filesize of a file at the beginning of a file transfer. 202Note that many servers will not respect this option. 203.Pp 204.It Cm verbose 205Toggle verbose mode. 206.El 207.Sh HISTORY 208The 209.Nm 210command appeared in 211.Bx 4.3 . 212IPv6 support was implemented by WIDE/KAME project in 1999. 213TFTP options were implemented by Wasabi Systems, Inc., in 2003, 214and first appeared in 215.Nx 2.0 . 216.Sh SECURITY CONSIDERATIONS 217Because there is no user-login or validation within 218the 219.Tn TFTP 220protocol, the remote site will probably have some 221sort of file-access restrictions in place. 222The exact methods are specific to each site and therefore 223difficult to document here. 224