📄 tftpd.8.in
字号:
.\" -*- nroff -*- --------------------------------------------------------- *.\" $Id: tftpd.8.in,v 1.12 2004/09/14 22:38:46 hpa Exp $.\" .\" Copyright (c) 1990, 1993, 1994.\" The Regents of the University of California. All rights reserved..\".\" Copyright 2001 H. Peter Anvin - All Rights Reserved.\".\" Redistribution and use in source and binary forms, with or without.\" modification, are permitted provided that the following conditions.\" are met:.\" 1. Redistributions of source code must retain the above copyright.\" notice, this list of conditions and the following disclaimer..\" 2. Redistributions in binary form must reproduce the above copyright.\" notice, this list of conditions and the following disclaimer in the.\" documentation and/or other materials provided with the distribution..\" 3. Neither the name of the University nor the names of its contributors.\" may be used to endorse or promote products derived from this software.\" without specific prior written permission..\".\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION).\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF.\" SUCH DAMAGE..\".\"----------------------------------------------------------------------- */.TH TFTPD 8 "3 September 2004" "tftp-hpa @@VERSION@@" "System Manager's Manual".SH NAME.B tftpd\- IPv4 Trivial File Transfer Protocol server.SH SYNOPSIS.B in.tftpd.RI [ options... ].I directory....SH DESCRIPTION.B tftpdis a server for the IPv4 Trivial File Transfer Protocol. The TFTPprotocol is extensively used to support remote booting of disklessdevices. The server is normally started by.BR inetd ,but can also run standalone..PP.SH OPTIONS.TP.B \-lRun the server in standalone (listen) mode, rather than run from.BR inetd .In listen mode, the.B \-toption is ignored, and the.B \-aoption can be used to specify a specific local address or port tolisten to..TP\fB\-a\fP \fI[address][:port]\fPSpecify a specific.I addressand.I portto listen to when called with the.B \-loption. The default is to listen to the.I tftpport specified in.I /etc/serviceson all local addresses..TP.B \-cAllow new files to be created. By default,.B tftpdwill only allow upload of files that already exist. Files are createdwith default permissions allowing anyone to read or write them, unlessthe.B \-por.B \-Uoptions are specified..TP.B \-sChange root directory on startup. This means the remote host does notneed to pass along the directory as part of the transfer, and may addsecurity. When.B \-sis specified, exactly one.I directoryshould be specified on the command line. The use of this option isrecommended for security as well as compatibility with some boot ROMswhich cannot be easily made to include a directory name in its request..TP\fB\-u\fP \fIusername\fPSpecify the username which.B tftpdwill run as; the default is "nobody". The user ID, group ID, and (ifpossible on the platform) the supplementary group IDs will be set tothe ones specified in the system permission database for thisusername..TP\fB\-U\fP \fIumask\fPSets the \fIumask\fP for newly created files to the specified value.The default is zero (anyone can read or write) if the.B \-poption is not specified, or inherited from the invoking process if.B \-pis specified..TP.B \-pPerform no additional permissions checks above the normalsystem-provided access controls for the user specified via the.B \-uoption..TP\fB\-t\fP \fItimeout\fPWhen run from.B inetdthis specifies how long, in seconds, to wait for a second connectionbefore terminating the server..B inetdwill then respawn the server when another request comes in. Thedefault is 900 (15 minutes.).TP\fB\-T\fP \fItimeout\fPDetermine the default timeout, in microseconds, before the firstpacket is retransmitted. This can be modified by the client if the.B timeoutor.B utimeoutoption is negotiated. The default is 1000000 (1 second.).TP\fB\-m\fP \fIremap-file\fPSpecify the use of filename remapping. The.I remap-fileis a file containing the remapping rules. See the section on filenameremapping below. This option may not be compiled in, see the output of.B "in.tftpd \-V"to verify whether or not it is available..TP.B \-vIncrease the logging verbosity of.BR tftpd .This flag can be specified multiple times for even higher verbosity..TP\fB\-r\fP \fItftp-option\fPIndicate that a specific RFC 2347 TFTP option should never beaccepted..TP\fB\-B\fP \fImax-block-size\fPSpecifies the maximum permitted block size. The permitted range forthis parameter is from 512 to 65464. Some embedded clients requestlarge block sizes and yet do not handle fragmented packets correctly;for these clients, it is recommended to set this value to the smallestMTU on your network minus 32 bytes (20 bytes for IP, 8 for UDP, and 4for TFTP; less if you use IP options on your network.) For example,on a standard Ethernet (MTU 1500) a value of 1468 is reasonable..TP.B \-VPrint the version number and configuration to standard output, thenexit gracefully..SH "RFC 2347 OPTION NEGOTIATION"This version of.B tftpdsupports RFC 2347 option negotation. Currently implemented optionsare:.TP\fBblksize\fP (RFC 2348)Set the transfer block size to anything less than or equal to thespecified option. This version of.B tftpdcan support any block size up to the theoretical maximum of 65464bytes..TP\fBblksize2\fP (nonstandard)Set the transfer block size to anything less than or equal to thespecified option, but restrict the possible responses to powers of 2.The maximum is 32768 bytes (the largest power of 2 less than or equalto 65464.).TP\fBtsize\fP (RFC 2349)Report the size of the file that is about to be transferred. Thisversion of.B tftpdonly supports the.B tsizeoption for binary (octet) mode transfers..TP\fBtimeout\fP (RFC 2349)Set the time before the server retransmits a packet, in seconds..TP\fButimeout\fP (nonstandard)Set the time before the server retransmits a packet, in microseconds..PPThe.B \-roption can be used to disable specific options; this may be necessaryto work around bugs in specific TFTP client implementations. Forexample, some TFTP clients have been found to request the.B blksizeoption, but crash with an error if they actually get the optionaccepted by the server..SH "FILENAME REMAPPING"The.B \-moption specifies a file which contains filename remapping rules. Eachnon-comment line (comments begin with hash marks,.BR # )contains an.IR operation ,specified below; a.IR regex ,a regular expression in the style of.BR egrep ;and optionally a.IR "replacement pattern" .The operation indicated by.I operationis performed if the.I regexmatches all or part of the filename. Rules are processed from the topdown, and by default, all rules are processed even if there is amatch..PPThe.I operationcan be any combination of the following letters:.TP.B rReplace the substring matched by.I regexby the.IR "replacement pattern" .The replacement pattern may contain escape sequences; see below..TP.B gRepeat this rule until it no longer matches. This is always used with.BR r ..TP.B iMatch the.I regexcase-insensitively. By default it is case sensitive..TP.B eIf this rule matches, end rule processing after executing the rule..TP.B sIf this rule matches, start rule processing over from the very firstrule after executing this rule..TP.B aIf this rule matches, refuse the request and send an access deniederror to the client..TP.B GThis rule applies to GET (RRQ) requests only..TP.B PThis rule applies to PUT (WRQ) requests only..TP.B ~Inverse the sense of this rule, i.e. execute the.I operationonly if the.I regex.I doesn'tmatch. Cannot used together with .BR r ..PPThe following escape sequences are recognized as part of the.IR "replacement pattern" :.TP\fB\\0\fPThe entire string matched by the.IR regex ..TP\fB\\1\fP to \fB\\9\fPThe strings matched by each of the first nine parenthesizedsubexpressions, \\( ... \\), of the.I regexpattern..TP\fB\\i\fPThe IP address of the requesting host, in dotted-quad notation(e.g. 192.0.2.169)..TP\fB\\x\fPThe IP address of the requesting host, in hexadecimal notation(e.g. C00002A9)..TP\fB\\\\\fPLiteral backslash..TP\fB\\\fP\fIwhitespace\fPLiteral whitespace..TP\fB\\#\fPLiteral hash mark..TP\fB\\U\fPTurns all subsequent letters to upper case..TP\fB\\L\fPTurns all subsequent letters to lower case..TP\fB\\E\fPCancels the effect of \fB\\U\fP or \fB\\L\fP..PPIf the mapping file is changed, you need to send.B SIGHUPto any outstanding.B tftpdprocess..SH "SECURITY"The use of TFTP services does not require an account or password onthe server system. Due to the lack of authentication information,.B tftpdwill allow only publicly readable files (o+r) to be accessed, unless the.B \-poption is specified. Files may be written only if they already existand are publicly writable, unless the.B \-coption is specified. Note that this extends the concept of ``public''to include all users on all hosts that can be reached through thenetwork; this may not be appropriate on all systems, and itsimplications should be considered before enabling TFTP service.Typically, some kind of firewall or packet-filter solution should beemployed. If appropriately compiled (see the output of.BR "in.tftpd \-V" ).B tftpdwill query the.BR hosts_access (5)database for access control information. This may be slow; sitesrequiring maximum performance may want to compile without this optionand rely on firewalling or kernel-based packet filters instead..PPThe server should be set to run as the user with the lowest possibleprivilege; please see the.B \-uflag. It is probably a good idea to set up a specific user account for.BR tftpd ,rather than letting it run as "nobody", to guard against privilegeleaks between applications..PPAccess to files can, and should, be restricted by invoking.B tftpdwith a list of directories by including pathnames as server programarguments on the command line. In this case access is restricted tofiles whole names are prefixed by one of the given directories. Ifpossible, it is recommended that the.B \-sflag is used to set up a chroot() environment for the server to run inonce a connection has been set up..PPFinally, the filename remapping.RB ( \-mflag) support can be used to provide a limited amount of additionalaccess control..SH "CONFORMING TO"RFC 1123,.IR "Requirements for Internet Hosts \- Application and Support" ..brRFC 1350,.IR "The TFTP Protocol (revision 2)" ..brRFC 2347,.IR "TFTP Option Extension" ..brRFC 2348,.IR "TFTP Blocksize Option" ..brRFC 2349,.IR "TFTP Timeout Interval and Transfer Size Options" ..SH "AUTHOR"This version of.B tftpdis maintained by H. Peter Anvin <hpa@zytor.com>. It was derived from,but has substantially diverged from, an OpenBSD source base, withadded patches by Markus Gutschke and Gero Kulhman..SH "SEE ALSO".BR tftp (1),.BR egrep (1),.BR umask (2),.BR hosts_access (5),.BR regex (7),.BR inetd (8).
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -