Define anondir as the directory to chroot(2) into for anonymous logins. Default is the home directory for the ftp user. This can also be specified with the ftpd.conf(5) chroot directive.
-c confdir
Change the root directory of the configuration files from "/etc" to confdir. This changes the directory for the following files: /etc/ftpchroot, /etc/ftpusers, /etc/ftpwelcome, /etc/motd, and the file specified by the ftpd.conf(5) limit directive.
-C user
Check whether user would be granted access under the restrictions given in ftpusers(5) and exit without attempting a connection. ftpd exits with an exit code of 0 if access would be granted, or 1 otherwise. This can be useful for testing configurations.
-d
Debugging information is written to the syslog using a facility of LOG_FTP.
-e emailaddr
Use emailaddr for the ""%E"" escape sequence (see Display file escape sequences)
-h hostname
Explicitly set the hostname to advertise as to hostname. The default is the hostname associated with the IP address that ftpd is listening on. This ability (with or without -h ), in conjunction with -c confdir, is useful when configuring 'virtual' FTP servers, each listening on separate addresses as separate names. Refer to inetd.conf(5) for more information on starting services to listen on specific IP addresses.
-H
Equivalent to " -h hostname ".
-l
Each successful and failed FTP session is logged using syslog with a facility of LOG_FTP. If this option is specified more than once, the retrieve (get), store (put), append, delete, make directory, remove directory and rename operations and their file name arguments are also logged.
-L xferlogfile
Log wu-ftpd style 'xferlog' entries to xferlogfile.
-P dataport
Use dataport as the data port, overriding the default of using the port one less that the port ftpd is listening on.
-q
Enable the use of pid files for keeping track of the number of logged-in users per class. This is the default.
-Q
Disable the use of pid files for keeping track of the number of logged-in users per class. This may reduce the load on heavily loaded FTP servers.
-r
Permanently drop root privileges once the user is logged in. The use of this option may result in the server using a port other than the (listening-port - 1) for PORT style commands, which is contrary to the RFC 959 specification, but in practice very few clients rely upon this behaviour. See SECURITY CONSIDERATIONS below for more details.
-s
Require a secure authentication mechanism like Kerberos or S/Key to be used.
-u
Log each concurrent FTP session to /var/run/utmp, making them visible to commands such as who(1).
-U
Dont log each concurrent FTP session to /var/run/utmp. This is the default.
-V version
Use version as the version to advertise in the login banner and in the output of STAT and SYST instead of the default version information. If version is empty or '-' then dont display any version information.
-w
Log each FTP session to /var/log/wtmp, making them visible to commands such as last(1). This is the default.
-W
Dont log each FTP session to /var/log/wtmp.
-X
Log wu-ftpd style 'xferlog' entries to the syslog, prefixed with ""xferlog: "", using a facility of LOG_FTP. These syslog entries can be converted to a wu-ftpd style xferlog file suitable for input into a third-party log analysis tool with a command similar to:
"grep xferlog: /var/log/xferlog | \"
" sed -e s/^.*xferlog: // Gt] wuxferlog"
The file /etc/nologin can be used to disable FTP access. If the file exists, ftpd displays it and exits. If the file /etc/ftpwelcome exists, ftpd prints it before issuing the "ready" message. If the file /etc/motd exists (under the chroot directory if applicable), ftpd prints it after a successful login. This may be changed with the ftpd.conf(5) directive motd.
The ftpd server currently supports the following FTP requests. The case of the requests is ignored.
Request Description ABOR "abort previous command" ACCT "specify account (ignored)" ALLO "allocate storage (vacuously)" APPE "append to a file" CDUP "change to parent of current working directory" CWD "change working directory" DELE "delete a file" EPSV "prepare for server-to-server transfer" EPRT "specify data connection port" FEAT "list extra features that are not defined in" "RFC 959" HELP "give help information" LIST "give list files in a directory"(""ls-lA"") LPSV "prepare for server-to-server transfer" LPRT "specify data connection port" MLSD "list contents of directory in a machine-processable form" MLST "show a pathname in a machine-processable form" MKD "make a directory" MDTM "show last modification time of file" MODE "specify data transfer" mode NLST "give name list of files in directory" NOOP "do nothing" OPTS "define persistent options for a given command" PASS "specify password" PASV "prepare for server-to-server transfer" PORT "specify data connection port" PWD "print the current working directory" QUIT "terminate session" REST "restart incomplete transfer" RETR "retrieve a file" RMD "remove a directory" RNFR "specify rename-from file name" RNTO "specify rename-to file name" SITE "non-standard commands (see next section)" SIZE "return size of file" STAT "return status of server" STOR "store a file" STOU "store a file with a unique name" STRU "specify data transfer" structure SYST "show operating system type of server system" TYPE "specify data transfer" type USER "specify user name" XCUP "change to parent of current working directory (deprecated)" XCWD "change working directory (deprecated)" XMKD "make a directory (deprecated)" XPWD "print the current working directory (deprecated)" XRMD "remove a directory (deprecated)"
The following non-standard or Unix specific commands are supported by the SITE request.
Request Description CHMOD "change mode of a file, e.g. SITE CHMOD 755 filename" HELP "give help information." IDLE "set idle-timer, e.g. SITE IDLE 60" RATEGET "set maximum get rate throttle in bytes/second, e.g. SITE RATEGET 5k" RATEPUT "set maximum put rate throttle in bytes/second, e.g. SITE RATEPUT 5k" UMASK "change umask, e.g. SITE UMASK 002"
The following FTP requests (as specified in RFC 959) are recognized, but are not implemented: ACCT, SMNT, and REIN. MDTM and SIZE are not specified in RFC 959, but will appear in the next updated FTP RFC.
The ftpd server will abort an active file transfer only when the ABOR command is preceded by a Telnet "Interrupt Process" (IP) signal and a Telnet "Synch" signal in the command Telnet stream, as described in Internet RFC 959. If a STAT command is received during a data transfer, preceded by a Telnet IP and Synch, transfer status will be returned.
ftpd interprets file names according to the "globbing" conventions used by csh(1). This allows users to use the metacharacters "*?[]{}~".
Make the home directory owned by "root" and unwritable by anyone.
~ftp/bin
Make this directory owned by "root" and unwritable by anyone (mode 555). Generally any conversion commands should be installed here (mode 111).
~ftp/etc
Make this directory owned by "root" and unwritable by anyone (mode 555). The files pwd.db (see passwd(5)) and group (see group(5)) must be present for the LIST command to be able to display owner and group names instead of numbers. The password field in passwd(5) is not used, and should not contain real passwords. The file motd, if present, will be printed after a successful login. These files should be mode 444.
~ftp/pub
This directory and the subdirectories beneath it should be owned by the users and groups responsible for placing files in them, and be writable only by them (mode 755 or 775). They should not be owned or writable by ftp or its group.
~ftp/incoming
This directory is where anonymous users place files they upload. The owners should be the user "ftp" and an appropriate group. Members of this group will be the only users with access to these files after they have been uploaded; these should be people who know how to deal with them appropriately. If you wish anonymous FTP users to be able to see the names of the files in this directory the permissions should be 770, otherwise they should be 370.
The following ftpd.conf(5) directives should be used:
"modify guest off"
"umask guest 0707"
"upload guest on"
This will result in anonymous users being able to upload files to this directory, but they will not be able to download them, delete them, or overwrite them, due to the umask and disabling of the commands mentioned above.
~ftp/tmp
This directory is used to create temporary files which contain the error messages generated by a conversion or LIST command. The owner should be the user "ftp". The permissions should be 300.
If you dont enable conversion commands, or dont want anonymous users uploading files here (see ~ftp/incoming above), then dont create this directory. However, error messages from conversion or LIST commands wont be returned to the user. (This is the traditional behaviour.) Note that the ftpd.conf(5) directive upload can be used to prevent users uploading here.
To set up "ftp-only" accounts that provide only FTP, but no valid shell login, you can copy/link /sbin/nologin to /sbin/ftplogin, and enter /sbin/ftplogin to /etc/shells to allow logging-in via FTP into the accounts, which must have /sbin/ftplogin as login shell.