www.usr.com/support/gpl/USR9113_release1.0.tar.gz
[bcm963xx.git] / userapps / opensource / ftpd / doc / en / bftpddoc-en.sgml
1 <!doctype linuxdoc system>\r
2 \r
3 <article>\r
4 \r
5 <!-- Title information -->\r
6 \r
7 <title>bftpd documentation</title>\r
8 <author>\r
9  <name>written by Max-Wilhelm Bruker <tt/&lt;brukie@gmx.net/&gt;</name>\r
10 </author>\r
11 <!--<date>$Id: bftpddoc-en.sgml,v 1.1.1.1 2006/05/24 20:04:52 mshtulberg Exp $</date>-->\r
12 \r
13 <abstract>\r
14 This document is the documentation for the bftpd FTP server.\r
15 </abstract>\r
16 \r
17 <!-- Table of contents -->\r
18 <toc>\r
19 \r
20 <!-- Begin the document -->\r
21 \r
22 <sect>Introduction\r
23  <p>\r
24 bftpd is an FTP server for Linux, BSD/OS, FreeBSD, Solaris, DG-UX and Tru64. (I don't know if it runs on other systems, please mail me if you have tried it). It runs either with inetd or standalone.\r
25  </p>\r
26  <p>\r
27   It tries to be very configurable while being fast and small. You can make defaults for each configuration option, and then override these defaults in user-specific and directory-specific structures.\r
28  </p>\r
29  <p>\r
30 Features of bftpd include:\r
31   <itemize>\r
32 <item>Easy configuration\r
33 <item>Speed\r
34 <item>Support for most RFC FTP commands\r
35 <item>tar.gz on-the-fly compression/archiving\r
36 <item>Security with chroot without special setup\r
37 <item>No need for files (sh, ls...) in a chroot environment\r
38 <item>Logging to wtmp and to a logfile or syslog\r
39 <item>PAM and passwd/shadow support\r
40 <item>Support for SITE CHOWN/CHMOD\r
41   </itemize>\r
42  </p>\r
43 </sect>\r
44 \r
45 <sect>Installation\r
46 <sect1>Compiling\r
47  <p>\r
48 First execute the following commands (replacing x.x.x by the version number you are installing):\r
49   <tscreen><verb>\r
50 tar xzf bftpd-x.x.x.tar.gz\r
51 cd bftpd-x.x.x\r
52 ./configure\r
53 make\r
54 make install\r
55   </verb></tscreen>\r
56 Note that you have to copy bftpd.conf from the source directory to /etc manually if you are upgrading from a previous version, as 'make install' does not overwrite your existing configuration.\r
57  </p>\r
58  <p>\r
59  Note: If you want to use the 'tar.gz on-the-fly' feature of bftpd, you must\r
60  grab the source code of the program &quot;pax&quot; and extract it into\r
61  a subdirectory of the bftpd source directory. Then, instead of doing\r
62  &quot;./configure&quot;, do &quot;./configure --enable-pax=pax-sourcedir --enable-libz&quot;.\r
63  You must also have the library libz and its header file, /usr/include/zlib.h.\r
64  </p>\r
65 <sect1>Running the server\r
66 <p>\r
67 bftpd runs in either standalone or inetd mode.\r
68   <descrip>\r
69 <tag>If you want inetd mode</tag>\r
70   Add the following to your /etc/inetd.conf:\r
71 <tscreen><verb>ftp stream tcp nowait root /usr/sbin/bftpd bftpd</verb></tscreen>\r
72   Give inetd a HUP or reboot your system. Your FTP server\r
73   should work now.\r
74 <tag>If you want inetd mode with xinetd</tag>\r
75   Add the following to your /etc/xinetd.conf:\r
76 <tscreen><verb>\r
77 service ftp\r
78 {\r
79     disable = no\r
80     socket_type             = stream\r
81     wait                    = no\r
82     user                    = root\r
83     server                  = /usr/sbin/bftpd\r
84     log_on_success          += DURATION USERID\r
85     log_on_failure          += USERID\r
86     nice                    = 10\r
87 }\r
88 </verb></tscreen>\r
89 (contributed by JackRipper)\r
90 <tag>If you want standalone mode:</tag>\r
91   Make the OS execute\r
92   <tscreen><verb>/usr/sbin/bftpd -d</verb></tscreen>\r
93   at bootup.\r
94   </descrip>\r
95  </p>\r
96 \r
97 <sect>Configuration\r
98 <sect1>User management\r
99 <p>\r
100 You can manage the users simply by editing /etc/passwd and, if your system supports it, /etc/shadow. Any user existent in /etc/passwd can connect to the FTP server if he has a usable password and meets certain configurable criteria. Having anonymous users is possible by setting a configuration variable called ANONYMOUS_USER to yes. PAM is also supported.\r
101 </p>\r
102 <sect1>The configuration file\r
103 <sect2>The global structure\r
104 <p>\r
105 In the &dquot;global&dquot; structure, you can assign values to configuration options. The syntax is like the following:\r
106 <tscreen><verb>\r
107 global {\r
108   name1="value1"\r
109   name2="value2"\r
110 }\r
111 </verb></tscreen>\r
112 </p>\r
113 <sect2>User structures\r
114 <p>\r
115 There are also user structures, in which you can override the global settings for particular users. Example:\r
116 <tscreen><verb>\r
117 global {\r
118   name1="value1"\r
119   name2="value2"\r
120 }\r
121 user foo {\r
122   name1="value3"\r
123 }\r
124 </verb></tscreen>\r
125 If the user foo is logged in, name1 will be value3. If another user is logged in, name1 will be value1. name2 is always value2.\r
126 </p>\r
127 <sect2>Group structures\r
128 <p>\r
129 You can also define options for groups of users. It is just as it would be for one user, but you can put more than one user in a group. You can also put system groups into them by using the @ character. Example:\r
130 <tscreen><verb>\r
131 group foo,bar,@baz {\r
132   name1="value1"\r
133 }\r
134 </verb></tscreen>\r
135 This options affect the users foo and bar and every user who is in the system group baz. A supplementary membership is sufficient.\r
136 </p>\r
137 <sect2>Directory structures\r
138 <p>\r
139 You can set options which affects only the users who are in a certain directory, or in any subdirectory of it, recursively. Note that you must put these structures <em>inside</em> the global, user and group structures. This way, you can also override directory-specific settings for particular users. Example:\r
140 <tscreen><verb>\r
141 global {\r
142   name1="value1"\r
143   directory "/foo" {\r
144     name1="value2"\r
145   }\r
146 }\r
147 user bar {\r
148   directory "/foo" {\r
149     name1="value3"\r
150   }\r
151 }\r
152 </verb></tscreen>\r
153 In this example, name1 will be value3 if the user bar is in the directory /foo. It will be value2 if another user is in the directory /foo. In any other case, it will be value1.\r
154 </p>\r
155 <p>\r
156 An explanation of the name/value pairs is in the example configuration file supplied with bftpd (if you are not upgrading, this file has already been copied to /etc on your system). Modify it so that it fits your needs. The defaults should be OK though.\r
157 </p>\r
158 \r
159 <sect>FAQ\r
160 <sect1>Problems while compiling\r
161 <sect2>I can't compile bftpd\r
162 <p>\r
163 Let me know. Please tell me what architecture and operating system you are using, and give me the output of the complete compilation process (configure and make). I don't get a lot of mail, so I'll try to answer your questions. If I don't reply, I have almost certainly forgotten your mail, so please send it again :)\r
164 </p>\r
165 <sect2>There are strange warnings\r
166 <p>\r
167 It is likely that compiling bftpd on a platform I haven't tested may give you some warnings. Even if it compiles successfully and runs without crashing, please tell me, as compiler warnings <em>can</em> cause problems which are not obvious.\r
168 </p>\r
169 <sect2>Make tells me I can't use wtmp\r
170 <p>\r
171 You are probably running Solaris. As I don't have access to a Solaris computer, I have never been able to test the wtmp functions in it. If you get a warning like this and you don't know what wtmp is, just don't care, else help me to fix the error.\r
172 </p>\r
173 <sect1>Problems when trying to run it\r
174 <sect2>I get a warning like &dquot;Could not get peer IP address.&dquot;\r
175 <p>\r
176 You have started bftpd on the console. If you want to run it as a standalone server, you have to invoke it with the &dquot;-d&dquot; option. If you have set it up as an inetd server, you can test it with:\r
177 <tscreen><verb>\r
178 hostname:&tilde;$ ftp localhost\r
179 </verb></tscreen>\r
180 </p>\r
181 <sect2>I get an error like &dquot;Bind failed: Address already in use.&dquot;\r
182 <p>\r
183 This error means that another process has bound itself to the port you want to run bftpd on. You can set this port in bftpd.conf with the option PORT in the global structure. It defaults to 21. If you have not changed that, you probably forgot to turn off your old FTP server. Look in /etc/inetd.conf and in &dquot;ps auxwww | grep ftp&dquot;.\r
184 </p>\r
185 <sect1>Problems during the FTP sessions\r
186 <sect2>I get an error like &dquot;500 Unknown command: 'foo'&dquot;\r
187 <p>\r
188 Your client has sent a command to the server which it didn't understand. This is my fault, unless you have written a really inexistent command. Please check your command for typographic errors and report the error to me if you are sure that the command was right.\r
189 </p>\r
190 <sect2>The session terminates with a 421 error\r
191 <p>\r
192 If you try to log in with a wrong password, bftpd will terminate the connection. If you already had logged in before the error appeared, or the error appeared before you could log in, it definitely is a bug. Please tell me everything about it.\r
193 </p>\r
194 <sect1>Miscellaneous\r
195 <sect2>How does the on-the-fly compression work?\r
196 <p>\r
197 Let's say you have a directory called foo. Even if there is no file called foo.tar.gz, you can RETR this file over FTP and it will contain the contents of the directory foo, tar-gzipped. You can also RETR the following files:\r
198 <itemize>\r
199 <item>dirname.tar</item>\r
200 <item>filename.gz</item>\r
201 </itemize>\r
202 If you want to use this, you must compile it in (see the installation section).\r
203 </p>\r
204 <sect2>My options for an anonymous user don't work\r
205 <p>\r
206 If you have a structure with an ALIAS=... in it, you mustn't put any more options in it. Instead, put them into the structure the alias points to.\r
207 </p>\r
208 <sect2>Why is there so little documentation?\r
209 <p>\r
210 The answer is simple, nobody has written anything :)<newline>\r
211 I never know what to write, so if you have any idea of how to improve the documentation, please tell me. The same applies to translations of documentation. If you want to contribute something, just do it, but <em>please</em> care about typographic errors and grammar.\r
212 </p>\r
213 <sect>Credits\r
214 <sect1>Portability testing\r
215 <p>\r
216 <itemize>\r
217 <item>David L. Nicol (david@kasey.umkc.edu) tested bftpd on Tru64.</item>\r
218 <item>JackRipper (vic@altoona.net) tested bftpd on BSD/OS and DG-UX.</item>\r
219 <item>Christian Beyerlein (christian@beyerlein.de) tested bftpd on FreeBSD and Solaris.</item>\r
220 <item>The people from #linux (IRCNet) tested bftpd on various operating systems.</item>\r
221 </itemize>\r
222 </p>\r
223 <sect1>Suggestions, bug reports &amp; code contributions\r
224 <p>\r
225 <itemize>\r
226 <item>Josh Woodcock (josh@hamparts.com) gave some hints about Solaris 8.</item>\r
227 <item>Floh (floh@maflohsoft.de) suggested the ASCII mode support.</item>\r
228 <item>Erik Hensema (erik@hensema.xs4all.nl) found a Linux 2.4.0 netfilter bug which affected bftpd.</item>\r
229 <item>Heiko Rother (rother@cmsnet.de) suggested a lot of things (see changelog).</item>\r
230 <item>Christophe Bailleux (cb@grolier.fr) loves to find problems in the directory listing routines. He also suggested a lot of things and contributed some code.</item>\r
231 <item>Jonathan Heusser (jonathanheusser@gyml.unibas.ch) found a buffer overflow bug.</item>\r
232 <item>Christian Beyerlein (christian@beyerlein.de) suggested to make user aliases.</item>\r
233 <item>Elmusafir (jslmarti@campus.cem.itesm.mx) reported the StarOffice problem fixed in 1.0.8.</item>\r
234 <item>Alex Madden (alexm@immstudios.com) and Daniel Mack (daniel.mack@nextra.de) reported the Solaris imcompatibility fixed in 1.0.8.</item>\r
235 <item>Daniel Mack (daniel.mack@nextra.de) contributed a big patch (see changelog).</item>\r
236 </itemize>\r
237 </p>\r
238 <sect1>Documentation contributions\r
239 <p>\r
240 <itemize>\r
241 <item>Radek Michalski (radek@end.p-s.com.pl) translates the bftpd docs into Polish and also contributes new text.</item>\r
242 </itemize>\r
243 </p>\r
244 <sect1>Others\r
245 <p>\r
246 <itemize>\r
247 <item>Some ideas about code structure and portability where taken from betaftpd bei Steinar H. Gunderson. But these were only a few lines!\r
248 </itemize>\r
249 </p>\r
250 </article>\r