ftpd(8c)
Name
ftpd − DARPA Internet File Transfer Protocol server
Syntax
/usr/etc/ftpd [ −d ] [ −l ] [ −ttimeout ]
Description
The ftpd server is the DARPA Internet File Transfer Protocol server process. The server uses the TCP protocol and is invoked by inetd(8c) when it receives a connection on the port specified in the ftp service specification. For further information, see services(5).
The ftp server currently supports the following ftp requests. Case is not distinguished.
RequestDescription
ABORAbort previous command
ACCTSpecify account
ALLOAllocate storage
APPEAppend to a file
CDUPChange to parent of current working directory
CWDChange working directory
DELEDelete a file
HELPGive help information
LISTGive list of files in a directory (ls −lg)
MKDMake a directory
MODESpecify data transfer mode
NLSTGive name list of files in directory (ls)
NOOPDo nothing
PASSSpecify password
PASVPrepare for server-to-server transfer
PORTSpecify data connection port
PWDPrint the current working directory
QUITTerminate session
RETRRetrieve a file
RMDRemove a directory
RNFRSpecify rename-from file name
RNTOSpecify rename-to file name
STORStore a file
STOUStore a file with a unique name
STRUSpecify data transfer structure
TYPESpecify data transfer type
USERSpecify user name
XCUPChange to parent of current working directory
XCWDChange working directory
XMKDMake a directory
XPWDPrint the current working directory
XRMDRemove a directory
The remaining ftp requests specified in Internet RFC 959 are recognized, but not implemented.
The ftpd server interprets file names according to the globbing conventions used by csh(1). This allows users to utilize the metacharacters *?[]{}~.
The ftpd server authenticates users according to three rules:
1.The user name must be in the password database, /etc/passwd, and not have a null password. In this case a password must be provided by the client before any file operations may be performed.
2.The user name must not appear in the file /etc/ftpusers.
3.If the user name is anonymous or ftp, an anonymous ftp account must be present in the password file (user ftp). In this case the user is allowed to log in by specifying any password (by convention this is given as the client host’s name).
In the last case, ftpd takes special measures to restrict the client’s access privileges. The server performs a chroot(2) command to the home directory of the ftp user. To prevent system security from being breached, it is recommended that the ftp subtree be constructed with care. Thus the following rules are recommended:
~ftp)Make the home directory owned by ftp and unwritable by anyone.
~ftp/bin)Make this directory owned by the superuser and unwritable by anyone. The program ls(1) must be present to support the list commands. This program should have mode 111.
~ftp/etc)Make this directory owned by the superuser and unwritable by anyone. The files passwd() and group() must be present for the ls command to work properly. These files should be mode 444.
~ftp/pub)
Make this directory mode 777 and owned by ftp. Place the files, which are to be accessible by the anonymous account, in this directory.
Options
−dEnables certain debugging messages that are printed by ftpd.
−lLogs each ftp session to the syslog.
−tSends the inactivity timeout period to timeout; otherwise, the ftp server will timeout an inactive session after 15 minutes.
Restrictions
Support does not exist for aborting commands.
The use of an anonymous account is inherently dangerous and should be avoided when possible.
The server must run as the superuser to create sockets with privileged port numbers. The server maintains an effective user id of the logged in user, reverting to the superuser only when binding addresses to sockets. The possible security holes have been extensively scrutinized, but are possibly incomplete.
Files
/etc/ftpusers
Contains the list of unauthorized users