It supports only the most-used features and commands of FTP, and leaves out everything which is deprecated, meaningless, or correlates with trouble.
Normal users are authenticated using USER, PASS and /etc/shells only. In particular, /etc/ftpusers is not consulted, since I think the name is misleading.
Anonymous users are authenticated in any of three ways:
1. The user logs in as "ftp" or "anonymous" and there is an account called "ftp" with an existing home directory. This server does not ask anonymous users for an email address or other password.
2. The user connects to an IP address which resolves to the name of a directory in /var/adm/ftp (or a symlink in that directory to a real directory), and there is an account called "ftp" (which does not need to have a valid home directory). See Virtual Servers below.
3. The user performs a CWD, PASV or PORT command without being authenticated by either of the previous methods, and there is an account called "ftp" with an existing home directory. This allows anonymous users to log in automatically, by simply changing directory, up- or downloading a file.
Ftpd does a chroot(2) to the relevant base directory when an anonymous user logs in.
Note that ftpd allows remote users to log in as root if the password is known and -u not used.
Ftpd never switches uid and euid, it uses setfsuid(2) instead. The main reason is that uid switching has been exploited in several breakins, but the sheer ugliness of uid switching counts too. Ftpd only calls setfsuid(2) once, at login.
As noted above, this ftpd omits several features that are required by the RFC or might be considered useful at first. Here is a list of the most important omissions.
ASCII mode transfer is omitted, because it's useful so seldom and trips careless users so often. If the client tries to download a file in ASCII mode, ftpd prints a warning at the start of the download.
STRU and MODE are not supported. If a client tries to set a structure other than file (the default) or a MODE other than ASCII, L8 or I ftpd refuses to play.
On-the-fly tar is not supported, for several reasons. I feel that users who want to get many files should use a special FTP client such as "mirror," which also supports incremental fetch. I don't want to either add several hundred lines of code to create tar files or execute an external tar. Finally, on-the-fly tar distorts log files.
On-the-fly compression is left out too. Most files on an FTP site are compressed already, and if a file isn't, there presumably is a reason why. (As for decompression: Don't FTP users waste bandwidth enough without help from on-the-fly decompression?)
Make ~ftp and all files and directories below this directory owned by some user other than "ftp," and only the .../incoming directory/directories writable by "ftp." It is probably best if all directories are writable only by a special group such as "ftpadmin" and "ftp" is not a member of this group.
If you do not trust the local users, put ~ftp on a separate partition, so local users can't hard-link unapproved files into the anonymous FTP area.
Use of the -s option is strongly suggested. (Simply add "-s" to the end of the ftpd line in /etc/inetd.conf to enable it.)
Most other FTP servers require that a number of files such as ~ftp/bin/ls exist. This server does not require that any files or directories within ~/ftp whatsoever exist, and I recommend that all such unnecessary files are removed (for no real reason).
It may be worth considering to run the anonymous FTP service as a virtual server, to get automatic logins and to firewall off the FTP address/port to which real users can log in.
If there is a file called .banner in the root directory of the anonymous FTP area, or in the root directory of a virtual host, and it is shorter than 1024 bytes, it is printed upon login. (If the client does not log in explicitly, and an implicit login is triggered by a CWD or CDUP command, the banner is not printed. This is regrettable but hard to avoid.)
If there is a file called .message in any directory and it is shorter than 1024 bytes, that file is printed whenever a user enters that directory using CWD or CDUP.
Here are the steps needed to create an extra server using an IP alias on linux 2.0.35, called "ftp.example.com