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