Anonymous FTP Daemon (aftpd)
Concept
Typical ftp-server stipulates that each remote user enters the system using their own account. The server creates a separate process to serve each session, and uses system calls setuid and setgid to accord permissions logged in user.
For public ftp-archives, that provide anonymous access (login: anonynous or ftp) for large number of users; this way is excessively resource-intensive: a large number of processes appears in the system (each have the same permissions); it causes bulky demand of memory and overrun CPU because of context switching from one process to another.
aftpd designed to make the work of anonymous ftp-archives more efficient, but does not provide facilities of typical ftp - login available only with permissions of an anonymous user.Overview
aftpd - ftp-server for anonymous access is designed for UNIX-like operating systems, that:
- Uses asynchronous model of connections' processing and provide service for all users within a single process.
- Can use multiple threads to run more efficiently on multi-core systems, with each thread serving multiple clients simultaneously.
- Uses effective mechanisms of transferring files, minimizing copying of data in RAM - sendfile or combination of system calls mmap/writev (if it is need to transform contents of the file). mmap is as well used on systems that doesn't support sendfile.
- Uses effective event notification schemes - kqueue on FreeBSD, epoll on Linux. It uses poll or select in older systems.
- Supports IPv6.
- For safety it works as unprivileged user and the chroot (after running "/" is moved to root directory of ftp-archive). Root permissions required to start.
- Uses syslog for error notifications and logged users.
Standards
Current version (0.0.2) is compatible with:
- RFC 959 FILE TRANSFER PROTOCOL.
- RFC 2389 Feature negotiation mechanism for the File Transfer Protocol.
and partly compatible with:
- RFC 2428 FTP Extensions for IPv6 and NATs. Doesn't support parameter ALL of EPSV command.
- RFC 3659 Extensions to FTP. Only REST, MDTM, SIZE commands are supported.
License
aftpd is released under 3-clause license BSD.
Compatibility
aftpd designated for a wide range of UNIX-like operating systems. But the current release 0.0.2 has been tested only on FreeBSD 7.2/i386 and Linux 2.6.3/i386.