TFTP(1C) BSD TFTP(1C)
NAME
tftp - trivial file transfer protocol
SYNOPSIS
tftp [ -g|g!|p|r|w ] local_file host remote_file [mode]
DESCRIPTION
The tftp command uses the Trivial File Transfer Protocol (TFTP) to copy
files among internet hosts without remote user-level access.
tftp requires an option to dictate the direction of the file transfer.
The recognized options are:
put (-p, -w)
Write the local file (local_file) onto the remote host's file
system as remote_file. Note that remote_file must be quoted
if it contains special shell characters. (The word put, the
option -p, and the option -w are all synonymous).
get (-g, -r)
Read the remote host's file (remote_file) into the local file
(local_file). If local_file already exists, tftp will fail
with an appropriate error message.
get! (-g!) Perform a tftp get, overwriting the local file (if it exists).
Note that the exclamation point following the command
indicates that the command will modify a data structure (in
this case, it will overwrite an existing file; the syntax is
derived from the Yale/T and MIT/Scheme naming conventions).
Within a UNIX shell, the exclamation point must be escaped
(usually with a backslash) to avoid shell interpretation.
The user must have read and write access to files on the local host.
Files transferred to the local host are either created or overwritten,
but never appended to. A minus sign (-) may be substituted for
local_file, in which case the standard input (or output) will be used.
The tftpd(8C) server running on the remote host imposes security
restrictions on which remote files may be read and written. These
restrictions differ for various tftpd implementations. For remote hosts
running the Domain/OS tftpd server, remote_file must be a pathname
beginning with "/" but not with "//" and not containing the string
"/../". In addition, remote_file must either contain the string "/tftp"
or begin with one of the directory names specified by the tftpd command
when that server was invoked. Furthermore, remote files may be read only
if the tftpd userid configured on the remote host has read access to
them, and remote files may be written only if they do not already exist
and if the configured tftpd userid has write access to them.
mode may be netascii or image. The default mode, netascii, transfers the
file as standard ascii characters. image mode transfers the file in
binary without character conversion.
NOTE
The Domain/OS versions of tftp and tftpd are adaptations of the MIT
Project Athena implementation of the TFTP protocol, as described in
RFC783. Domain/OS tftp will interface with any RFC783-compliant
implementation. Note, however, that the 4.3BSD distribution version of
tftp does not meet these restrictions.
WARNING
tftp allows users to copy files across an internet without login or
authentication on any remote host running a tftpd server. If the tftpd
server on a host is configured and run to allow tftp transactions, the
file access restrictions imposed by that tftpd server provide the only
security for files on that host. Therefore, the desired security of a
host should be considered before configuring and running the tftpd server
to allow tftp transactions.
EXAMPLES
Each of the following examples presumes that there is a host on the
internet called hosta, running a tftpd server.
1. tftp -p filea hosta /tftp/filex
Copies the local file filea to hosta, and deposits it in hosta's /tftp
directory under the name filex.
2. tftp get fileb hosta /usr/tftpdir/filey
Copies the remote file (on hosta) named /usr/tftpdir/filey to the local
file named fileb.
3. tftp -g\! filec hosta /tftp/filez image
Copies the remote binary file (on hosta) named /tftp/filez to the local
file named filec, overwriting the old copy of filec.
With UNIX C shells, the exclamation point must be escaped, usually with a
backslash as shown in this example, to avoid interpretation by the shell.
SEE ALSO
tftpd(8C);
Configuring and Managing TCP/IP;
Using TCP/IP Network Applications.