TFTPD(8)

NAME
tftpd - IPv4 Trivial File Transfer Protocol server

SYNOPSIS
in.tftpd [-v] [-c] [-l] [-a [address][:port]] [-m mapfile] [-u userid] [-t timeout] [-r option...] [-s] [directory]

DESCRIPTION
tftpd is a server which supports the DARPA Trivial File Transfer Protocol. The TFTP server operates at the port indicated in the ‘tftp’ service description; see services(5). The server is normally started by inetd(8), but can also run standalone.

The use of tftp(1) does not require an account or password on the remote system. Due to the lack of authentication information, tftpd will allow only publicly readable files to be accessed. Files may be written only if they already exist and are publicly writable. Note that this extends the concept of “public” to include all users on all hosts that can be reached through the network; this may not be appropriate on all systems, and its implications should be considered before enabling tftp service. The server should have the user ID with the lowest possible privilege (see the -u flag below.)

Access to files may be restricted by invoking tftpd with a list of directories by including pathnames as server program arguments in /etc/inetd.conf or on the standalone server command line. In this case access is restricted to files whose names are prefixed by the one of the given directories.

If the -l flag is used, the server runs in standalone (listen) mode. In listen mode, the -t option is ignored, and the -a option can be used to specify a specific local address or port to listen to.

If the -c flag is used, tftpd will allow new files to be created; otherwise uploaded files must already exist. Files are created with default permissions allowing anyone to read or write to them.

When using the -s flag with a directory name, tftpd will chroot(2) on startup; therefore the remote host is not expected to pass the directory as part of the file name to transfer. This option is recommended for security, as well as compatibility with boot ROMs which do not include a directory name.

The -u option can be used to specify a user ID which tftpd will run as; the default is ``nobody''.

The -t option specifies the server timeout in inetd mode.

The -m flag specifies a file which contains filename remapping rules.

The -v flag increases the logging verbosity of tftpd, it can be specified multiple times.

This version of tftpd supports RFC 2347 option negotiation; the current version supports the blksize (RFC 2348), tsize, (RFC 2349), and timeout (RFC 2349) options. The -r flag can be used to disable options individually; this may allow working around client bugs.

FILENAME REMAPPING
The -m option specifies a file which contains filename remapping rules. Each non-comment line (comments begin with hash marks, #) contains an operation, a regex, a regular expression in the style of egrep(1), and optionally a replacement pattern. The operation indicated by operation is performed if the regex matches all or part of the filename. Rules are processed from the top down, and by default, all rules are processed even if there is a match.

The operation can be any combination of the following letters:

r   Replace the substring matched by regex by the replacement pattern. The escape sequence \0 can be used to copy the entire matched string, and the sequences \1 to \9 copies parenthesized subexpressions. To specify a backslash, white space or hash mark, you need to \-escape it.

g   Repeat this rule until it no longer matches. This is always used with r.

i   Match the regex case-insensitively. By default it is case sensitive.

e   If this rule matches, end rule processing after executing the rule.

s   If this rule matches, start rule processing over from the very first rule after executing this rule.

a   If this rule matches, refuse the request and send an access denied error to the client.

G   This rule applies to GET (RRQ) requests only.

P   This rule applies to PUT (WRQ) requests only.

If the mapping file is changed, you need to send SIGHUP (kill -HUP) to any outstanding tftpd process.

SEE ALSO
tftp(1), egrep(1), regex(7), inetd(8)

HISTORY
The tftpd command appeared in 4.2BSD.

The -s flag appeared in NetBSD 0.9a.

The -c flag was added in OpenBSD 2.1 .

The -r flag and RFC 2347 options were added by H. Peter Anvin based on patches by Markus Gutschke and Gero Kulhman.

The -u, -v and -m flags were added by H. Peter Anvin.