Things you have to decide before starting:

* The location of the FTP home directory, normally /usr/ftp. You will
put files into /usr/ftp/pub to make them available to the world. (To
change this directory, edit conf-home.h now.)

* Whether to reuse an existing anonymous FTP area. If you are already
supplying anonymous FTP service, you can continue to supply the same
files through anonftpd. Many hosts are supplying /usr/spool/ftp. (You
will use this decision in step 4 of the installation.)

* The uid and gid that anonftpd will run under; for example, 12345 6789.
If your system already has an ftp account, you can use that account's
uid and gid. Otherwise you should create a new uid and gid. (You will
use these numbers in step 5 of the installation.)


How to install:

 1. Create the formatted man pages, *.0:
       # make man
 2. Compile the programs:
       # make
 3. Create the FTP home directory:
       # make setup
 4. If you decided to reuse an existing anonymous FTP area, replace
    /usr/ftp/pub with a symbolic link to that area:
       # mv /usr/ftp/pub /usr/ftp/pub.empty
       # ln -s /usr/spool/ftp /usr/ftp/pub
    (Here /usr/spool/ftp is the name of your area.)
 5. Set up anonftpd in /etc/inetd.conf (all on one line):
	    ftp stream tcp nowait root
	    /usr/ftp/bin/anonftpd anonftpd 12345 6789
    (Here 12345 and 6789 are your selected uid and gid.)
 6. Reboot. (Or kill -HUP your inetd process.)


How to test:

 7. Connection test: See if you can connect to anonftpd.
       % ftp 127.0.0.1
       Connected to 127.0.0.1.
       220 Hi there! This is anonftpd.
       Name (127.0.0.1:yourusername): 
       230 Hi. No need to log in; I'm an anonymous ftp server.
       ftp> pwd
       257 "/"
       ftp> quit
       221 Bye.
    The 230, 257, and 221 lines should appear exactly as shown here.
 8. Directory listing test: Create a file in /usr/ftp/pub, and see if it
    is visible through anonftpd.
       # echo hello world > /usr/ftp/pub/hello
       # chmod 644 /usr/ftp/pub/hello
       # ls -i /usr/ftp/pub/hello
       19887 /usr/ftp/pub/hello
       # ftp 127.0.0.1
       Connected to 127.0.0.1.
       220 Hi there! This is anonftpd.
       Name (127.0.0.1:root): 
       230 Hi. No need to log in; I'm an anonymous ftp server.
       ftp> dir
       150 I'm looking through the directory. Trying to connect...
       +i18874375.19887,m826416431,r,s12,	hello
       226 Finished transferring 42 bytes.
       ftp> quit
       221 Bye.
    You will see different numbers, but the number shown by ls -i should
    show up again in the FTP directory listing. m826416431 is a numeric
    representation of the modification time of the file; r means that
    the file is retrievable; s12 means that the file has 12 bytes. Under
    Solaris you will see some extra directory entries for dev and etc;
    those are required by the operating system.
 9. File retrieval test: Try to get the file from /usr/ftp/pub.
       % ftp 127.0.0.1
       Connected to 127.0.0.1.
       220 Hi there! This is anonftpd.
       Name (127.0.0.1:yourusername): 
       230 Hi. No need to log in; I'm an anonymous ftp server.
       ftp> bin
       200 Okay, using binary.
       ftp> get hello hello.copy
       150 I see that file. Trying to connect...
       226 Finished transferring 12 bytes.
       12 bytes received in 0.0006 seconds (19 Kbytes/s)
       ftp> quit
       221 Bye.
       # cmp /usr/ftp/pub/hello hello.copy
       #
    The 150 and 226 lines should be exactly as shown here, and cmp
    should not show any differences.
10. Chroot test: Try to escape from /usr/ftp/pub via FTP with
       ftp> cd ..
    or
       ftp> cd /
    You should not be able to find any files outside /usr/ftp/pub.
11. Hidden file test: Create a filename with a tilde, and look for it
    via FTP. It should not show up.
12. Statistics: Check the anonftpd log to see if it reports each of your
    file retrievals.
       % ./anonftpstat `find /usr/ftp/pub -print` < /usr/ftp/log
    If you do not want to keep a log, link /usr/ftp/log to /dev/null:
       # rm /usr/ftp/log
       # ln -s /dev/null /usr/ftp/log


That's it! You can set up /usr/ftp/pub any way you want. See anonftpd.0
for further hints. To report success:
       % cat `cat SYSDEPS` | mail djb-qst@koobera.math.uic.edu
