2 written by Max-Wilhelm Bruker <brukie@gmx.net>
5 This document is the documentation for the bftpd FTP server.
6 ______________________________________________________________________
14 2.2 Running the server
18 3.2 The configuration file
19 3.2.1 The global structure
21 3.2.3 Group structures
22 3.2.4 Directory structures
25 4.1 Problems while compiling
26 4.1.1 I can't compile bftpd
27 4.1.2 There are strange warnings
28 4.1.3 Make tells me I can't use wtmp
29 4.2 Problems when trying to run it
30 4.2.1 I get a warning like "Could not get peer IP address."
31 4.2.2 I get an error like "Bind failed: Address already in use."
32 4.3 Problems during the FTP sessions
33 4.3.1 I get an error like "500 Unknown command: 'foo'"
34 4.3.2 The session terminates with a 421 error
36 4.4.1 How does the on-the-fly compression work?
37 4.4.2 My options for an anonymous user don't work
38 4.4.3 Why is there so little documentation?
41 5.1 Portability testing
42 5.2 Suggestions, bug reports & code contributions
43 5.3 Documentation contributions
47 ______________________________________________________________________
49 \e[1m1. Introduction
\e[0m
51 bftpd is an FTP server for Linux, BSD/OS, FreeBSD, Solaris, DG-UX and
52 Tru64. (I don't know if it runs on other systems, please mail me if
53 you have tried it). It runs either with inetd or standalone.
55 It tries to be very configurable while being fast and small. You can
56 make defaults for each configuration option, and then override these
57 defaults in user-specific and directory-specific structures.
59 Features of bftpd include:
61 +
\bo Easy configuration
65 +
\bo Support for most RFC FTP commands
67 +
\bo tar.gz on-the-fly compression/archiving
69 +
\bo Security with chroot without special setup
71 +
\bo No need for files (sh, ls...) in a chroot environment
73 +
\bo Logging to wtmp and to a logfile or syslog
75 +
\bo PAM and passwd/shadow support
77 +
\bo Support for SITE CHOWN/CHMOD
79 \e[1m2. Installation
\e[0m
81 \e[1m2.1. Compiling
\e[0m
83 First execute the following commands (replacing x.x.x by the version
84 number you are installing):
87 tar xzf bftpd-x.x.x.tar.gz
95 Note that you have to copy bftpd.conf from the source directory to
96 /etc manually if you are upgrading from a previous version, as 'make
97 install' does not overwrite your existing configuration.
99 Note: If you want to use the 'tar.gz on-the-fly' feature of bftpd, you
100 must grab the source code of the program "pax" and extract it into a
101 subdirectory of the bftpd source directory. Then, instead of doing
102 "./configure", do "./configure --enable-pax=pax-sourcedir --enable-
103 libz". You must also have the library libz and its header file,
106 \e[1m2.2. Running the server
\e[0m
108 bftpd runs in either standalone or inetd mode.
110 \e[1mIf you want inetd mode
\e[0m
111 Add the following to your /etc/inetd.conf:
114 ftp stream tcp nowait root /usr/sbin/bftpd bftpd
118 Give inetd a HUP or reboot your system. Your FTP server should work
121 \e[1mIf you want inetd mode with xinetd
\e[0m
122 Add the following to your /etc/xinetd.conf:
132 server = /usr/sbin/bftpd
133 log_on_success += DURATION USERID
134 log_on_failure += USERID
140 (contributed by JackRipper)
142 \e[1mIf you want standalone mode:
\e[0m
152 \e[1m3. Configuration
\e[0m
154 \e[1m3.1. User management
\e[0m
156 You can manage the users simply by editing /etc/passwd and, if your
157 system supports it, /etc/shadow. Any user existent in /etc/passwd can
158 connect to the FTP server if he has a usable password and meets
159 certain configurable criteria. Having anonymous users is possible by
160 setting a configuration variable called ANONYMOUS_USER to yes. PAM is
163 \e[1m3.2. The configuration file
\e[0m
165 \e[1m3.2.1. The global structure
\e[0m
167 In the "global" structure, you can assign values to configuration
168 options. The syntax is like the following:
178 \e[1m3.2.2. User structures
\e[0m
180 There are also user structures, in which you can override the global
181 settings for particular users. Example:
195 If the user foo is logged in, name1 will be value3. If another user is
196 logged in, name1 will be value1. name2 is always value2.
198 \e[1m3.2.3. Group structures
\e[0m
200 You can also define options for groups of users. It is just as it
201 would be for one user, but you can put more than one user in a group.
202 You can also put system groups into them by using the @ character.
212 This options affect the users foo and bar and every user who is in the
213 system group baz. A supplementary membership is sufficient.
215 \e[1m3.2.4. Directory structures
\e[0m
217 You can set options which affects only the users who are in a certain
218 directory, or in any subdirectory of it, recursively. Note that you
219 must put these structures
\e[4minside
\e[24m the global, user and group
220 structures. This way, you can also override directory-specific
221 settings for particular users. Example:
238 In this example, name1 will be value3 if the user bar is in the direc-
239 tory /foo. It will be value2 if another user is in the directory /foo.
240 In any other case, it will be value1.
242 An explanation of the name/value pairs is in the example configuration
243 file supplied with bftpd (if you are not upgrading, this file has
244 already been copied to /etc on your system). Modify it so that it fits
245 your needs. The defaults should be OK though.
250 \e[1m4.1. Problems while compiling
\e[0m
252 \e[1m4.1.1. I can't compile bftpd
\e[0m
254 Let me know. Please tell me what architecture and operating system you
255 are using, and give me the output of the complete compilation process
256 (configure and make). I don't get a lot of mail, so I'll try to answer
257 your questions. If I don't reply, I have almost certainly forgotten
258 your mail, so please send it again :)
260 \e[1m4.1.2. There are strange warnings
\e[0m
262 It is likely that compiling bftpd on a platform I haven't tested may
263 give you some warnings. Even if it compiles successfully and runs
264 without crashing, please tell me, as compiler warnings
\e[4mcan
\e[24m cause
265 problems which are not obvious.
267 \e[1m4.1.3. Make tells me I can't use wtmp
\e[0m
269 You are probably running Solaris. As I don't have access to a Solaris
270 computer, I have never been able to test the wtmp functions in it. If
271 you get a warning like this and you don't know what wtmp is, just
272 don't care, else help me to fix the error.
274 \e[1m4.2. Problems when trying to run it
\e[0m
276 \e[1m4.2.1. I get a warning like "Could not get peer IP address."
\e[0m
278 You have started bftpd on the console. If you want to run it as a
279 standalone server, you have to invoke it with the "-d" option. If you
280 have set it up as an inetd server, you can test it with:
283 hostname:~$ ftp localhost
287 \e[1m4.2.2. I get an error like "Bind failed: Address already in use."
\e[0m
289 This error means that another process has bound itself to the port you
290 want to run bftpd on. You can set this port in bftpd.conf with the
291 option PORT in the global structure. It defaults to 21. If you have
292 not changed that, you probably forgot to turn off your old FTP server.
293 Look in /etc/inetd.conf and in "ps auxwww | grep ftp".
295 \e[1m4.3. Problems during the FTP sessions
\e[0m
297 \e[1m4.3.1. I get an error like "500 Unknown command: 'foo'"
\e[0m
299 Your client has sent a command to the server which it didn't
300 understand. This is my fault, unless you have written a really
301 inexistent command. Please check your command for typographic errors
302 and report the error to me if you are sure that the command was right.
304 \e[1m4.3.2. The session terminates with a 421 error
\e[0m
306 If you try to log in with a wrong password, bftpd will terminate the
307 connection. If you already had logged in before the error appeared, or
308 the error appeared before you could log in, it definitely is a bug.
309 Please tell me everything about it.
313 \e[1m4.4. Miscellaneous
\e[0m
315 \e[1m4.4.1. How does the on-the-fly compression work?
\e[0m
317 Let's say you have a directory called foo. Even if there is no file
318 called foo.tar.gz, you can RETR this file over FTP and it will contain
319 the contents of the directory foo, tar-gzipped. You can also RETR the
326 If you want to use this, you must compile it in (see the
327 installation section).
329 \e[1m4.4.2. My options for an anonymous user don't work
\e[0m
331 If you have a structure with an ALIAS=... in it, you mustn't put any
332 more options in it. Instead, put them into the structure the alias
335 \e[1m4.4.3. Why is there so little documentation?
\e[0m
337 The answer is simple, nobody has written anything :)
338 I never know what to write, so if you have any idea of how to improve
339 the documentation, please tell me. The same applies to translations of
340 documentation. If you want to contribute something, just do it, but
341 \e[4mplease
\e[24m care about typographic errors and grammar.
345 \e[1m5.1. Portability testing
\e[0m
348 +
\bo David L. Nicol (david@kasey.umkc.edu) tested bftpd on Tru64.
350 +
\bo JackRipper (vic@altoona.net) tested bftpd on BSD/OS and DG-UX.
352 +
\bo Christian Beyerlein (christian@beyerlein.de) tested bftpd on
355 +
\bo The people from #linux (IRCNet) tested bftpd on various operating
358 \e[1m5.2. Suggestions, bug reports & code contributions
\e[0m
361 +
\bo Josh Woodcock (josh@hamparts.com) gave some hints about Solaris 8.
363 +
\bo Floh (floh@maflohsoft.de) suggested the ASCII mode support.
365 +
\bo Erik Hensema (erik@hensema.xs4all.nl) found a Linux 2.4.0 netfilter
366 bug which affected bftpd.
368 +
\bo Heiko Rother (rother@cmsnet.de) suggested a lot of things (see
371 +
\bo Christophe Bailleux (cb@grolier.fr) loves to find problems in the
372 directory listing routines. He also suggested a lot of things and
373 contributed some code.
375 +
\bo Jonathan Heusser (jonathanheusser@gyml.unibas.ch) found a buffer
379 +
\bo Christian Beyerlein (christian@beyerlein.de) suggested to make user
382 +
\bo Elmusafir (jslmarti@campus.cem.itesm.mx) reported the StarOffice
383 problem fixed in 1.0.8.
385 +
\bo Alex Madden (alexm@immstudios.com) and Daniel Mack
386 (daniel.mack@nextra.de) reported the Solaris imcompatibility fixed
389 +
\bo Daniel Mack (daniel.mack@nextra.de) contributed a big patch (see
392 \e[1m5.3. Documentation contributions
\e[0m
395 +
\bo Radek Michalski (radek@end.p-s.com.pl) translates the bftpd docs
396 into Polish and also contributes new text.
398 \e[1m5.4. Others
\e[0m
401 +
\bo Some ideas about code structure and portability where taken from
402 betaftpd bei Steinar H. Gunderson. But these were only a few lines!