-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathINSTALL
405 lines (255 loc) · 11.7 KB
/
INSTALL
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
bftpd documentation
written by Max-Wilhelm Bruker <[email protected]>
This document is the documentation for the bftpd FTP server.
______________________________________________________________________
Table of Contents
1. Introduction
2. Installation
2.1 Compiling
2.2 Running the server
3. Configuration
3.1 User management
3.2 The configuration file
3.2.1 The global structure
3.2.2 User structures
3.2.3 Group structures
3.2.4 Directory structures
4. FAQ
4.1 Problems while compiling
4.1.1 I can't compile bftpd
4.1.2 There are strange warnings
4.1.3 Make tells me I can't use wtmp
4.2 Problems when trying to run it
4.2.1 I get a warning like "Could not get peer IP address."
4.2.2 I get an error like "Bind failed: Address already in use."
4.3 Problems during the FTP sessions
4.3.1 I get an error like "500 Unknown command: 'foo'"
4.3.2 The session terminates with a 421 error
4.4 Miscellaneous
4.4.1 How does the on-the-fly compression work?
4.4.2 My options for an anonymous user don't work
4.4.3 Why is there so little documentation?
5. Credits
5.1 Portability testing
5.2 Suggestions, bug reports & code contributions
5.3 Documentation contributions
5.4 Others
______________________________________________________________________
[1m1. Introduction[0m
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.
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.
Features of bftpd include:
+o Easy configuration
+o Speed
+o Support for most RFC FTP commands
+o tar.gz on-the-fly compression/archiving
+o Security with chroot without special setup
+o No need for files (sh, ls...) in a chroot environment
+o Logging to wtmp and to a logfile or syslog
+o PAM and passwd/shadow support
+o Support for SITE CHOWN/CHMOD
[1m2. Installation[0m
[1m2.1. Compiling[0m
First execute the following commands (replacing x.x.x by the version
number you are installing):
tar xzf bftpd-x.x.x.tar.gz
cd bftpd-x.x.x
./configure
make
make install
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.
Note: If you want to use the 'tar.gz on-the-fly' feature of bftpd, you
must grab the source code of the program "pax" and extract it into a
subdirectory of the bftpd source directory. Then, instead of doing
"./configure", do "./configure --enable-pax=pax-sourcedir --enable-
libz". You must also have the library libz and its header file,
/usr/include/zlib.h.
[1m2.2. Running the server[0m
bftpd runs in either standalone or inetd mode.
[1mIf you want inetd mode[0m
Add the following to your /etc/inetd.conf:
ftp stream tcp nowait root /usr/sbin/bftpd bftpd
Give inetd a HUP or reboot your system. Your FTP server should work
now.
[1mIf you want inetd mode with xinetd[0m
Add the following to your /etc/xinetd.conf:
service ftp
{
disable = no
socket_type = stream
wait = no
user = root
server = /usr/sbin/bftpd
log_on_success += HOST PID
log_on_failure += HOST
nice = 10
}
(contributed by JackRipper)
[1mIf you want standalone mode:[0m
Make the OS execute
/usr/sbin/bftpd -d
at bootup.
[1m3. Configuration[0m
[1m3.1. User management[0m
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.
[1m3.2. The configuration file[0m
[1m3.2.1. The global structure[0m
In the "global" structure, you can assign values to configuration
options. The syntax is like the following:
global {
name1="value1"
name2="value2"
}
[1m3.2.2. User structures[0m
There are also user structures, in which you can override the global
settings for particular users. Example:
global {
name1="value1"
name2="value2"
}
user foo {
name1="value3"
}
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.
[1m3.2.3. Group structures[0m
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:
group foo,bar,@baz {
name1="value1"
}
This options affect the users foo and bar and every user who is in the
system group baz. A supplementary membership is sufficient.
[1m3.2.4. Directory structures[0m
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 [4minside[24m the global, user and group
structures. This way, you can also override directory-specific
settings for particular users. Example:
global {
name1="value1"
directory "/foo" {
name1="value2"
}
}
user bar {
directory "/foo" {
name1="value3"
}
}
In this example, name1 will be value3 if the user bar is in the direc-
tory /foo. It will be value2 if another user is in the directory /foo.
In any other case, it will be value1.
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.
[1m4. FAQ[0m
[1m4.1. Problems while compiling[0m
[1m4.1.1. I can't compile bftpd[0m
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 :)
[1m4.1.2. There are strange warnings[0m
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 [4mcan[24m cause
problems which are not obvious.
[1m4.1.3. Make tells me I can't use wtmp[0m
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.
[1m4.2. Problems when trying to run it[0m
[1m4.2.1. I get a warning like "Could not get peer IP address."[0m
You have started bftpd on the console. If you want to run it as a
standalone server, you have to invoke it with the "-d" option. If you
have set it up as an inetd server, you can test it with:
hostname:~$ ftp localhost
[1m4.2.2. I get an error like "Bind failed: Address already in use."[0m
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 "ps auxwww | grep ftp".
[1m4.3. Problems during the FTP sessions[0m
[1m4.3.1. I get an error like "500 Unknown command: 'foo'"[0m
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.
[1m4.3.2. The session terminates with a 421 error[0m
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.
[1m4.4. Miscellaneous[0m
[1m4.4.1. How does the on-the-fly compression work?[0m
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:
+o dirname.tar
+o filename.gz
If you want to use this, you must compile it in (see the
installation section).
[1m4.4.2. My options for an anonymous user don't work[0m
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.
[1m4.4.3. Why is there so little documentation?[0m
The answer is simple, nobody has written anything :)
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
[4mplease[24m care about typographic errors and grammar.
[1m5. Credits[0m
[1m5.1. Portability testing[0m
+o David L. Nicol ([email protected]) tested bftpd on Tru64.
+o JackRipper ([email protected]) tested bftpd on BSD/OS and DG-UX.
+o Christian Beyerlein ([email protected]) tested bftpd on
FreeBSD and Solaris.
+o The people from #linux (IRCNet) tested bftpd on various operating
systems.
[1m5.2. Suggestions, bug reports & code contributions[0m
+o Josh Woodcock ([email protected]) gave some hints about Solaris 8.
+o Floh ([email protected]) suggested the ASCII mode support.
+o Erik Hensema ([email protected]) found a Linux 2.4.0 netfilter
bug which affected bftpd.
+o Heiko Rother ([email protected]) suggested a lot of things (see
changelog).
+o Christophe Bailleux ([email protected]) loves to find problems in the
directory listing routines. He also suggested a lot of things and
contributed some code.
+o Jonathan Heusser ([email protected]) found a buffer
overflow bug.
+o Christian Beyerlein ([email protected]) suggested to make user
aliases.
+o Elmusafir ([email protected]) reported the StarOffice
problem fixed in 1.0.8.
+o Alex Madden ([email protected]) and Daniel Mack
([email protected]) reported the Solaris imcompatibility fixed
in 1.0.8.
+o Daniel Mack ([email protected]) contributed a big patch (see
changelog).
[1m5.3. Documentation contributions[0m
+o Radek Michalski ([email protected]) translates the bftpd docs
into Polish and also contributes new text.
[1m5.4. Others[0m
+o Some ideas about code structure and portability where taken from
betaftpd bei Steinar H. Gunderson. But these were only a few lines!