Better error messages.
[tftp-hpa.git] / README.security
blob58eab7f4084dc70c05f7a881c9503b9452178c32
1 $Id$
3                =======================================
5 Starting in version 0.27, tftp-hpa has the option of a "use Unix
6 permissions" mode.  In this mode, tftpd can access any file accessible
7 by the tftpd effective user, specified via the -u option.  This means
8 that files no longer need to be set to o+r or o+w.
10 If file creation is enabled (via the -c option), the -p option also
11 changes the default umask from 0 (anyone can read or write) to
12 "unchanged" (inherited from the calling process.)  The -U option can
13 be used to override the default umask; this is recommended.
15 The sanest setup, from a security standpoint, for tftpd to run in is
16 probably the following:
18 1. Create a separate "tftpd" user and group only used for tftpd;
19 2. Have all your boot files in a single directory tree (usually called 
20    /tftpboot).
21 3. Specify "-p -u tftpd -s /tftpboot" on the tftpd command line; if
22    you want clients to be able to create files use
23    "-p -c -U 002 -u tftpd -s /tftpboot" (replace 002 with whatever
24    umask is appropriate for your setup.)
26                =======================================
28 Starting in version 0.17, tftp-hpa operates in genuine "wait" mode,
29 which means that an in.tftpd process hangs around for some time after
30 the last service request has arrived.  This speeds up servicing a
31 subsequent request, which apparently has been a problem in the past,
32 resulting in "request storms" as the client keeps retrying, resulting
33 in multiple connections on the server which the client has already
34 abandoned.
36 This also means that spawning tftp via tcpd is useless (in fact, this
37 indirection seems to be part of the reason for these "request
38 storms.")  Instead, tftp-hpa supports calling the tcpwrapper library
39 directly.  Thus, if your /etc/inetd.conf looks like this (all on one
40 line):
42 tftp    dgram   udp     wait    root    /usr/sbin/tcpd
43 /usr/sbin/in.tftpd -s /tftpboot -r blksize
45 ... it's better to change to ...
47 tftp    dgram   udp     wait    root    /usr/sbin/in.tftpd
48 in.tftpd -s /tftpboot -r blksize
50 You should make sure that you are using "wait" option in tftpd; you
51 also need to have tftpd spawned as root in order for chroot (-s) to
52 work.  tftpd automatically drops privilege and changes user ID to
53 "nobody" by default; the appropriate user ID for tftpd can be
54 specified with the -u option (e.g. "-u tftpuser").
56 If you are running a busy boot server, I would suggest to instead use
57 kernel-based firewalling rules, and to compile tftpd without
58 tcpwrapper support, in order to provide significantly better
59 performance.  To do so, specify the --without-tcpwrappers option to
60 configure when compiling; see the INSTALL.tftp file for more information.