pure-ftpd(8) | Pure-FTPd | pure-ftpd(8) |
pure-ftpd - simple File Transfer Protocol server
pure-ftpd [-0] [-1] [-2 cert_file[,key_file]] [-3 certd_socket] [-4] [-6] [-a gid] [-A] [-b] [-B] [-c clients] [-C cnx/ip] [-d [-d]] [-D] [-e] [-E] [-f facility] [-F fortunes file] [-g pidfile] [-G] [-H] [-i] [-I] [-j] [-J ciphers] [-k percentage] [-K] [-l authentication[:config file]] [-L max files:max depth] [-m maxload] [-M] [-n maxfiles:maxsize] [-N] [-o] [-O format:log file] [-p first:last] [-P ip address or host name] [-q upload:download ratio] [-Q upload:download ratio] [-r] [-R] [-s] [-S [address,][port]] [-t upload bandwidth:download bandwidth] [-T upload bandwidth:download bandwidth] [-u uid] [-U umask files:umask dirs] [-v bonjour name] [-V ip address] [-w] [-W] [-x] [-X] [-y max user sessions:max anon sessions] [-Y tls behavior] [-z] [-Z]
Alternative style:
-0 --notruncate
-1 --logpid
-2 --certfile
-3 --extcert
-4 --ipv4only
-6 --ipv6only
-a --trustedgid
-A --chrooteveryone
-b --brokenclientscompatibility
-B --daemonize
-c --maxclientsnumber
-C --maxclientsperip
-d --verboselog
-D --displaydotfiles
-e --anonymousonly
-E --noanonymous
-f --syslogfacility
-F --fortunesfile
-g --pidfile
-G --norename
-h --help
-H --dontresolve
-i --anonymouscantupload
-I --maxidletime
-j --createhomedir
-J --tlsciphersuite
-k --maxdiskusagepct
-K --keepallfiles
-l --login
-L --limitrecursion
-m --maxload
-M --anonymouscancreatedirs
-n --quota
-N --natmode
-o --uploadscript
-O --altlog
-p --passiveportrange
-P --forcepassiveip
-q --anonymousratio
-Q --userratio
-r --autorename
-R --nochmod
-s --antiwarez
-S --bind
-t --anonymousbandwidth
-T --userbandwidth
-u --minuid
-U --umask
-v --bonjour
-V --trustedip
-w --allowuserfxp
-W --allowanonymousfxp
-x --prohibitdotfileswrite
-X --prohibitdotfilesread
-y --peruserlimits
-Y --tls
-z --allowdotfiles
-Z --customerproof
Pure-FTPd is a small, simple server for the old and hairy File Transfer Protocol, designed to use less resources than older servers, be smaller and very secure, and to never execute any external program.
It support most-used features and commands of FTP (including many modern extensions), and leaves out everything which is deprecated, meaningless, insecure, or correlates with trouble.
IPv6 is fully supported.
Some of the complexities of older servers are left out.
This version of pure-ftpd can use PAM for authentication. If you want it to consult any files like /etc/shells or /etc/ftpd/ftpusers consult pam docs. LDAP directories and SQL databases are also supported.
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 /etc/pure-ftpd/pure-ftpd (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.
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.
If a user's home directory is /path/to/home/./, FTP sessions under that UID will be chroot()ed. In addition, if a users's home directory is /path/to/home/./directory the session will be chroot()ed to /path/to/home and the FTP session will start in 'directory'.
As noted above, this pure-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.
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?)
Shortcuts for the "cd" command can be set up if the server has been compiled with the --with-diraliases feature.
To enable directory aliases, create a file called /etc/pure-ftpd/pureftpd-dir-aliases and alternate lines of alias names and associated directories.
This server leaves out some of the commands and features that have been used to subvert anonymous FTP servers in the past, but still you have to be a little bit careful in order to support anonymous FTP without risk to the rest of your files.
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 your server is a public FTP site, you may want to allow only 'ftp' and 'anonymous' users to log in. Use the -e option for this. Real accounts will be ignored and you will get a secure, anonymous-only FTP server.
The files <ftproot>/.banner and .message are magical.
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.
You can run several different anonymous FTP servers on one host, by giving the host several IP addresses with different DNS names.
Here are the steps needed to create an extra server using an IP alias on linux 2.4.x, called "ftp.example.com" on address 10.11.12.13. on the IP alias eth0.
1. Create an "ftp" account if you do not have one. It it best if the account does not have a valid home directory and shell. I prefer to make /dev/null the ftp account's home directory and shell. Ftpd uses this account to set the anonymous users' uid.
2. Create a directory as described in Anonymous FTP and make a symlink called /etc/pure-ftpd/pure-ftpd/10.11.12.13 which points to this directory.
3. Make sure your kernel has support for IP aliases.
4. Make sure that the following commands are run at boot:
/sbin/ifconfig eth0:1 10.11.12.13
That should be all. If you have problems, here are some things to try.
First, symlink /etc/pure-ftpd/pure-ftpd/127.0.0.1 to some directory and say "ftp localhost". If that doesn't log you in, the problem is with ftpd.
If not, "ping -v 10.11.12.13" and/or "ping -v ftp.example.com" from the same host. If this does not work, the problem is with the IP alias.
Next, try "ping -v 10.11.12.13" from a host on the local ethernet, and afterwards "/sbin/arp -a". If 10.11.12.13 is listed among the ARP entries with the correct hardware address, the problem is probably with the IP alias. If 10.11.12.13 is listed, but has hardware address 0:0:0:0:0:0, then proxy-ARP isn't working.
If none of that helps, I'm stumped. Good luck.
Warning: If you setup a virtual hosts, normal users will not be able to login via this name, so don't create link/directory in /etc/pure-ftpd/pure-ftpd for your regular hostname.
/etc/passwd is used via libc (and PAM is this case), to get the uid and home directory of normal users, the uid and home directory of "ftp" for normal anonymous ftp, and just the uid of "ftp" for virtual ftp hosts.
/etc/shadow is used like /etc/passwd if shadow support is enabled.
/etc/group is used via libc, to get the group membership of normal users.
/proc/net/tcp is used to count existing FTP connections, if the -c or -p options are used
/etc/pure-ftpd/pure-ftpd/<ip address> is the base directory for the <ip address> virtual ftp server, or a symbolic link to its base directory. Ftpd does a chroot(2) into this directory when a user logs in to <ip address>, thus symlinks outside this directory will not work.
~ftp is the base directory for "normal" anonymous FTP. Ftpd does a chroot(2) into this directory when an anonymous user logs in, thus symlinks outside this directory will not work.
The behaviour of LIST and NLST is a tricky issue. Few servers send RFC-compliant responses to LIST, and some clients depend on non-compliant responses.
This server uses glob(3) to do filename globbing.
The response to NLST is by default similar to that of ls(1), and that to LIST is by default similar to that of ls -l or ls -lg on most Unix systems, except that the "total" count is meaningless. Only regular files, directories and symlinks are shown. Only important ls options are supported:
Here are the FTP commands supported by this server.
ABOR ALLO APPE AUTH TLS CCC CDUP
CWD DELE EPRT EPSV ESTA ESTP
FEAT HELP LIST MDTM MFMT MKD
MLSD MLST MODE NLST NOOP PASS
PASV PBSZ PORT PROT PWD QUIT
REST RETR RMD RNFR RNTO SIZE
STAT STOR STOU STRU SYST TYPE
USER XCUP XCWD XDBG XMKD XPWD
XRMD OPTS MLST SITE CHMOD SITE HELP SITE
IDLE SITE TIME SITE UTIME
Please report bugs to the mailing-list (see below). Pure-FTPd looks very stable and is used on production servers. However it comes with no warranty and it can have nasty bugs or security flaws.
http://www.pureftpd.org/
See the mailing-list on http://www.pureftpd.org/ml/.
Troll-FTPd was written by Arnt Gulbrandsen <agulbra@troll.no> and copyright 1995-2002 Troll Tech AS, Waldemar Thranes gate 98B, N-0175 Oslo, Norway, fax +47 22806380.
Pure-FTPd is (C)opyleft 2001-2021 by Frank DENIS <j at pureftpd dot org>.
This software is covered by the BSD license.
Contributors:
Arnt Gulbrandsen,
Troll Tech AS,
Janos Farkas,
August Fullford,
Ximenes Zalteca,
Patrick Michael Kane,
Arkadiusz Miskiewicz,
Michael K. Johnson,
Kelley Lingerfelt,
Sebastian Andersson,
Andreas Westin,
Jason Lunz,
Mathias Gumz,
Claudiu Costin,
Ping,
Paul Lasarev,
Jean-Mathieux Schaffhauser,
Emmanuel Hocdet,
Sami Koskinen,
Sami Farin,
Luis Llorente Campo,
Peter Pentchev,
Darren Casey,
The Regents of the University of California,
Theo de Raadt (OpenBSD),
Matthias Andree,
Isak Lyberth,
Steve Reid,
RSA Data Security Inc,
Trilucid,
Dmtry Lebkov,
Johan Huisman,
Thorsten Kukuk,
Jan van Veen,
Roger Constantin Demetrescu,
Stefano F.,
Robert Varga,
Freeman,
James Metcalf,
Im Eunjea,
Philip Gladstone,
Kenneth Stailey,
Brad Smith,
Ulrik Sartipy,
Cindy Marasco,
Nicolas Doye,
Thomas Briggs,
Stanton Gallegos,
Florin Andrei,
Chan Wilson,
Bjoern Metzdorf,
Ben Gertzfield,
Akhilesch Mritunjai,
Dawid Szymanski,
Kurt Inge Smadal,
Alex Dupre,
Gabriele Vinci,
Andrey Ulanov,
Fygul Hether,
Jeffrey Lim,
Ying-Chieh Liao,
Johannes Erdfelt,
Martin Sarfy,
Clive Goodhead,
Aristoteles Pagaltzis,
Stefan Hornburg,
Mehmet Cokcevik,
Brynjar Eide,
Torgnt Wernersson,
Banhalmi Csaba,
Volodin D,
Oriol Magran,
Jui-Nan Lin,
Patrick Gosling,
Marc Balmer,
Rajat Upadhyaya / Novell,
Christian Cier-Zniewski,
Wilco Baan Hofman,
Clement Chauplannaz.
ftp(1), pure-ftpd(8) pure-ftpwho(8) pure-mrtginfo(8) pure-uploadscript(8) pure-statsdecode(8) pure-pw(8) pure-quotacheck(8) pure-authd(8) pure-certd(8)
RFC 959, RFC 2228, RFC 2389, RFC 2428 and RFC 4217.
1.0.50 | Frank Denis |