.\" -*- nroff -*- --------------------------------------------------------- * .\" .\" SPDX-License-Identifier: BSD-4-Clause-UC .\" .\" Copyright (c) 1990, 1993, 1994 .\" The Regents of the University of California. All rights reserved. .\" .\" Copyright 2001-2026 H. Peter Anvin - All Rights Reserved .\" .\"----------------------------------------------------------------------- */ .TH TFTP 1 "20 September 2026" "tftp-hpa 7.2" "User's Manual" .SH "NAME" .B tftp \- Trivial File Transfer Protocol (TFTP) client .SH "SYNOPSIS" .B tftp [ \fIoptions...\fP ] [\fIhost\fP [\fIport\fP]] [\fB\-c\fP \fIcommand\fP] .SH "DESCRIPTION" .B tftp is a client for the Trivial file Transfer Protocol, which can be used to transfer files to and from remote machines, including some very minimalistic, usually embedded, systems. The remote .I host may be specified on the command line, in which case .B tftp uses .I host as the default host for future transfers (see the .B connect command below.) .SH "OPTIONS" .TP .B \-4, \-\-ipv4 Connect with IPv4 only, even if IPv6 support was compiled in. .TP .B \-6, \-\-ipv6 Connect with IPv6 only, if compiled in. .TP \fB\-c\fP, \fB\-\-command\fP \fIcommand\fP Execute \fIcommand\fP as if it had been entered on the .B tftp prompt. Must be specified last on the command line. .TP \fB\-l\fP, \fB\-\-literal\fP Default to literal mode. Used to avoid special processing of \[lq]:\[rq] in a file name. .TP \fB\-m\fP, \fB\-\-mode\fP \fImode\fP Set the default transfer mode to \fImode\fP. \fImode\fP can be either .B netascii (convert line endings) or .B octet (direct binary transfer without any conversions.) .IP This is usually used with \-c. .TP \fB\-a\fP, \fB\-\-ascii\fP, \fB\-\-netascii\fP, \fB\-\-text\fP Equivalent to .RB \\[lq] "\-\-mode netascii" \\[rq]. .TP \fB\-b\fP, \fB\-\-binary\fP, \fB\-\-octet\fP Equivalent to .RB \\[lq] "\-\-mode octet" \\[rq]. .TP \fB\-B\fP, \fB\-\-blocksize\fP \fImax-block-size\fP Specifies the maximum permitted block size. The permitted range for this parameter is from 512 to 65464, or it can be specified as .RB \\[lq] mtu \\[rq], or \[lq]\fBmtu-\fP\fIslack\fP\[rq]. When .B mtu is specified, .B tftp will try to query the maximum transmission unit (MTU) from the kernel and size the maximum block size accordingly. If .I slack is specified, the MTU value will be adjusted downward by .I slack bytes. .B tftp does not request the option if the block size is set to 512. .IP The default is .BR mtu . .TP \fB\-W\fP, \fB\-w\fP, \fB\-\-windowsize\fP \fIwindow-size\fP Request the RFC 7440 \fBwindowsize\fP option. This permits up to \fIwindow-size\fP data blocks to be sent before an acknowledgment is required. Valid values are 1 through 32768. .B tftp does not request the option if the window size is set to 1. .IP The default is 64. .TP \fB\-T\fP, \fB\-\-no-tsize\fP Disable the sending of the RFC 2349 \fBtsize\fP (transfer size) option. The default is to send the option. .TP \fB\-N\fP, \fB\-\-no-options\fP Do not request any TFTP options, for maximum compatibility with old servers. This is equivalent to .br .RB \\[lq] "--blocksize 512 --windowsize 1 --no-tsize" \\[rq]. .TP \fB\-U\fP, \fB\-\-unsafe\fP Allow a TFTP response to come from a different address than the server address to which the request was sent. .IP Some old TFTP servers have been known to return a response from a network address other than the one to which the request was originally sent. This increases the (already considerable) risk of connection hijacking, and is therefore disallowed by default. .TP \fB\-R\fP, \fB\-\-port-range\fP \fImin-port:max-port\fP Force the originating (local) port number to be in the specified range of port numbers. .TP \fB\-v\fP, \fB\-\-verbose\fP[=\fIlevel\fP] Default to verbose mode. At .I level 2 or higher, do not round byte counts in statistics or use suffixes. .TP \fB\-V\fP, \fB\-\-version\fP Print the version number and configuration to standard output, then exit gracefully. .TP \fB\-h\fP, \fB\-\-help\fP [\fIcommand\fP] If \fIcommand\fP is specified, print help text for \fIcommand\fP and exit. Otherwise print a command line options summary and exit. .IP Use \fB\-c help\fP to get a list of commands available with \fB\-c\fP. .SH "COMMANDS" Once .B tftp is running, it issues the prompt \fBtftp>\fP and recognizes the following commands: .TP \fB?\fP \fIcommand-name...\fP .TP \fBhelp\fP \fIcommand-name...\fP Print help information .TP .B ascii Shorthand for .RB \\[lq] "mode ascii" \\[rq]. .TP .B binary Shorthand for .BR "mode binary" . .TP \fBconnect\fP \fIhost [port]\fP Set the .I host (and optionally .IR port ) for transfers. Note that the TFTP protocol, unlike the FTP protocol, does not maintain connections between transfers; thus, the .B connect command does not actually create a connection, but merely remembers what host is to be used for transfers. You do not have to use the .B connect command; the remote host can be specified as part of the .B get or .B put commands. .TP \fBget\fP \fIfile\fP .sp -.6l .TP \fBget\fP \fIremotefile localfile\fP .sp -.6l .TP \fBget\fP \fIfile1 file2 file3...\fP Get a file or set of files from the specified sources. A remote filename can be in one of two forms: a plain filename on the remote host, if the host has already been specified, or a string of the form .I host:filename to specify both a host and filename at the same time. If the latter form is used, the last hostname specified becomes the default for future transfers. Enable .B literal mode to prevent special treatment of the ':' character (e.g. if the desired filename is .RB \\[lq] "C:\\edir\\efile" \\[rq]). .TP \fBmget\fP \fIfile1 file2 ... local-directory\fP Get one or more files from the specified remote sources into \fIlocal-directory\fP. Each remote filename can be a plain filename on the configured remote host, or a string of the form .I host:filename to specify both a host and filename at the same time. If the latter form is used, the last hostname specified becomes the default for future transfers. Enable .B literal mode to prevent special treatment of the .RB \\[lq] : \\[rq] character (e.g. if the desired filename is .RB \\[lq] "C:\\edir\\efile" \\[rq]). .TP .B literal Toggle literal mode. When set, this mode prevents special treatment of ':' in filenames. .TP \fBmode\fP \fItransfer-mode\fP Specify the mode for transfers; .I transfer-mode may be one of .B netascii (or .BR ascii ) or .B octet (or .BR binary .) The default is .BR octet . .TP \fBblocksize\fP \fIblock-size\fP Set the requested block size to \fIblock-size\fP. See the .B \-\-blocksize command-line option. .TP \fBput\fP \fIfile\fP .sp -.6l .TP \fBput\fP \fIlocalfile remotefile\fP .sp -.6l .TP \fBput\fP \fIfile1 file2 file3... remote-directory\fP Put a file or set of files to the specified remote file or directory. The destination can be in one of two forms: a filename on the remote host, if the host has already been specified, or a string of the form .I host:filename to specify both a host and filename at the same time. If the latter form is used, the hostname specified becomes the default for future transfers. If the remote-directory form is used, the remote host is assumed to be a UNIX system or another system using .B / as directory separator. Enable .B literal mode to prevent special treatment of the ':' character (e.g. C:\\dir\\file). .TP \fBmput\fP \fIfile1 file2 ... remote-directory\fP Put one or more files to \fIremote-directory\fP. The destination can be a directory on the configured remote host, or a string of the form .I host:directory to specify both a host and directory at the same time. If the latter form is used, the hostname specified becomes the default for future transfers. The remote host is assumed to use .B / as directory separator. Enable .B literal mode to prevent special treatment of the ':' character (e.g. C:\\dir\\file). .TP .B quit Exit .BR tftp . End-of-file will also exit. .TP \fBrexmt\fP \fIretransmission-timeout\fP Set the initial per-packet retransmission timeout, in seconds. Each subsequent retry doubles this interval. .TP .B status Show current status. .TP \fBtimeout\fP \fItotal-transmission-timeout\fP Set the maximum retransmission interval, in seconds. .TP \fBwindowsize\fP \fIwindow-size\fP Request the RFC 7440 \fBwindowsize\fP option with \fIwindow-size\fP data blocks per window. Valid values are 1 through 32768. .TP \fBtsize\fP Toggle sending the RFC 2349 \fBtsize\fP (transfer size) option. The default is on, unless the \fB\-\-no-tsize\fP command line option was given. .TP \fBoptions\fP Toggle the sending of TFTP options entirely. The default is enabled, unless the \fB\-\-no-options\fP command line option was given. If disabled, TFTP options are never sent; if enabled, TFTP options .I may be sent. .TP .B trace Toggle packet tracing (a debugging feature.) .TP .B verbose Toggle verbose mode. .SH "NOTES" The TFTP protocol provides no provisions for authentication or security. Therefore, the remote server will probably implement some kinds of access restriction or firewalling. These access restrictions are likely to be site- and server-specific. .SH "AUTHOR" This version of .B tftp is maintained by H. Peter Anvin . It was derived from, but has substantially diverged from, an OpenBSD source base, with added patches by Markus Gutschke and Gero Kulhman. .SH "SEE ALSO" .BR tftpd (8).