# BRCM_VERSION=3
[bcm963xx.git] / userapps / opensource / ftpd / doc / en / bftpddoc-en.txt
1   bftpd documentation
2   written by Max-Wilhelm Bruker <brukie@gmx.net>
3
4
5   This document is the documentation for the bftpd FTP server.
6   ______________________________________________________________________
7
8   Table of Contents
9
10
11   1. Introduction
12   2. Installation
13      2.1 Compiling
14      2.2 Running the server
15
16   3. Configuration
17      3.1 User management
18      3.2 The configuration file
19         3.2.1 The global structure
20         3.2.2 User structures
21         3.2.3 Group structures
22         3.2.4 Directory structures
23
24   4. FAQ
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
35      4.4 Miscellaneous
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?
39
40   5. Credits
41      5.1 Portability testing
42      5.2 Suggestions, bug reports & code contributions
43      5.3 Documentation contributions
44      5.4 Others
45
46
47   ______________________________________________________________________
48
49   \e[1m1.  Introduction\e[0m
50
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.
54
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.
58
59   Features of bftpd include:
60
61   +\bo  Easy configuration
62
63   +\bo  Speed
64
65   +\bo  Support for most RFC FTP commands
66
67   +\bo  tar.gz on-the-fly compression/archiving
68
69   +\bo  Security with chroot without special setup
70
71   +\bo  No need for files (sh, ls...) in a chroot environment
72
73   +\bo  Logging to wtmp and to a logfile or syslog
74
75   +\bo  PAM and passwd/shadow support
76
77   +\bo  Support for SITE CHOWN/CHMOD
78
79   \e[1m2.  Installation\e[0m
80
81   \e[1m2.1.  Compiling\e[0m
82
83   First execute the following commands (replacing x.x.x by the version
84   number you are installing):
85
86
87        tar xzf bftpd-x.x.x.tar.gz
88        cd bftpd-x.x.x
89        ./configure
90        make
91        make install
92
93
94
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.
98
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,
104   /usr/include/zlib.h.
105
106   \e[1m2.2.  Running the server\e[0m
107
108   bftpd runs in either standalone or inetd mode.
109
110      \e[1mIf you want inetd mode\e[0m
111         Add the following to your /etc/inetd.conf:
112
113
114           ftp stream tcp nowait root /usr/sbin/bftpd bftpd
115
116
117
118      Give inetd a HUP or reboot your system. Your FTP server should work
119      now.
120
121      \e[1mIf you want inetd mode with xinetd\e[0m
122         Add the following to your /etc/xinetd.conf:
123
124
125
126      service ftp
127      {
128          disable = no
129          socket_type             = stream
130          wait                    = no
131          user                    = root
132          server                  = /usr/sbin/bftpd
133          log_on_success          += DURATION USERID
134          log_on_failure          += USERID
135          nice                    = 10
136      }
137
138
139
140      (contributed by JackRipper)
141
142      \e[1mIf you want standalone mode:\e[0m
143         Make the OS execute
144
145
146           /usr/sbin/bftpd -d
147
148
149
150      at bootup.
151
152   \e[1m3.  Configuration\e[0m
153
154   \e[1m3.1.  User management\e[0m
155
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
161   also supported.
162
163   \e[1m3.2.  The configuration file\e[0m
164
165   \e[1m3.2.1.  The global structure\e[0m
166
167   In the "global" structure, you can assign values to configuration
168   options. The syntax is like the following:
169
170
171        global {
172          name1="value1"
173          name2="value2"
174        }
175
176
177
178   \e[1m3.2.2.  User structures\e[0m
179
180   There are also user structures, in which you can override the global
181   settings for particular users. Example:
182
183
184
185   global {
186     name1="value1"
187     name2="value2"
188   }
189   user foo {
190     name1="value3"
191   }
192
193
194
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.
197
198   \e[1m3.2.3.  Group structures\e[0m
199
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.
203   Example:
204
205
206        group foo,bar,@baz {
207          name1="value1"
208        }
209
210
211
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.
214
215   \e[1m3.2.4.  Directory structures\e[0m
216
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:
222
223
224        global {
225          name1="value1"
226          directory "/foo" {
227            name1="value2"
228          }
229        }
230        user bar {
231          directory "/foo" {
232            name1="value3"
233          }
234        }
235
236
237
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.
241
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.
246
247
248   \e[1m4.  FAQ\e[0m
249
250   \e[1m4.1.  Problems while compiling\e[0m
251
252   \e[1m4.1.1.  I can't compile bftpd\e[0m
253
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 :)
259
260   \e[1m4.1.2.  There are strange warnings\e[0m
261
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.
266
267   \e[1m4.1.3.  Make tells me I can't use wtmp\e[0m
268
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.
273
274   \e[1m4.2.  Problems when trying to run it\e[0m
275
276   \e[1m4.2.1.  I get a warning like "Could not get peer IP address."\e[0m
277
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:
281
282
283        hostname:~$ ftp localhost
284
285
286
287   \e[1m4.2.2.  I get an error like "Bind failed: Address already in use."\e[0m
288
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".
294
295   \e[1m4.3.  Problems during the FTP sessions\e[0m
296
297   \e[1m4.3.1.  I get an error like "500 Unknown command: 'foo'"\e[0m
298
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.
303
304   \e[1m4.3.2.  The session terminates with a 421 error\e[0m
305
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.
310
311
312
313   \e[1m4.4.  Miscellaneous\e[0m
314
315   \e[1m4.4.1.  How does the on-the-fly compression work?\e[0m
316
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
320   following files:
321
322   +\bo  dirname.tar
323
324   +\bo  filename.gz
325
326      If you want to use this, you must compile it in (see the
327      installation section).
328
329   \e[1m4.4.2.  My options for an anonymous user don't work\e[0m
330
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
333   points to.
334
335   \e[1m4.4.3.  Why is there so little documentation?\e[0m
336
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.
342
343   \e[1m5.  Credits\e[0m
344
345   \e[1m5.1.  Portability testing\e[0m
346
347
348   +\bo  David L. Nicol (david@kasey.umkc.edu) tested bftpd on Tru64.
349
350   +\bo  JackRipper (vic@altoona.net) tested bftpd on BSD/OS and DG-UX.
351
352   +\bo  Christian Beyerlein (christian@beyerlein.de) tested bftpd on
353      FreeBSD and Solaris.
354
355   +\bo  The people from #linux (IRCNet) tested bftpd on various operating
356      systems.
357
358   \e[1m5.2.  Suggestions, bug reports & code contributions\e[0m
359
360
361   +\bo  Josh Woodcock (josh@hamparts.com) gave some hints about Solaris 8.
362
363   +\bo  Floh (floh@maflohsoft.de) suggested the ASCII mode support.
364
365   +\bo  Erik Hensema (erik@hensema.xs4all.nl) found a Linux 2.4.0 netfilter
366      bug which affected bftpd.
367
368   +\bo  Heiko Rother (rother@cmsnet.de) suggested a lot of things (see
369      changelog).
370
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.
374
375   +\bo  Jonathan Heusser (jonathanheusser@gyml.unibas.ch) found a buffer
376      overflow bug.
377
378
379   +\bo  Christian Beyerlein (christian@beyerlein.de) suggested to make user
380      aliases.
381
382   +\bo  Elmusafir (jslmarti@campus.cem.itesm.mx) reported the StarOffice
383      problem fixed in 1.0.8.
384
385   +\bo  Alex Madden (alexm@immstudios.com) and Daniel Mack
386      (daniel.mack@nextra.de) reported the Solaris imcompatibility fixed
387      in 1.0.8.
388
389   +\bo  Daniel Mack (daniel.mack@nextra.de) contributed a big patch (see
390      changelog).
391
392   \e[1m5.3.  Documentation contributions\e[0m
393
394
395   +\bo  Radek Michalski (radek@end.p-s.com.pl) translates the bftpd docs
396      into Polish and also contributes new text.
397
398   \e[1m5.4.  Others\e[0m
399
400
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!
403
404
405