-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathuserguide.sgml
11154 lines (8743 loc) · 352 KB
/
userguide.sgml
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
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook V4.1//EN" [
<!ENTITY directivesbyname SYSTEM "directives/output/by_name_source.sgml">
<!ENTITY directivesbymodule SYSTEM "directives/output/by_module_source.sgml">
<!ENTITY directivesbycontext SYSTEM "directives/output/by_context_source.sgml">
]>
<book ID="PROFTPD"><?dbhtml filename="userguide.html">
<bookinfo>
<title>Proftpd</title>
<subtitle>A User's Guide</subtitle>
<authorgroup>
<author>
<firstname>Mark</firstname><surname>Lowes</surname>
</author>
</authorgroup>
<ISBN>None.</ISBN>
<RELEASEINFO>Build 20020919 - draft</RELEASEINFO>
<PUBDATE>$Date$</PUBDATE>
<edition>Version 0.1.4</edition>
<pubdate>31/Jan/2001</pubdate>
<copyright><year>2001</year>
<holder>Mark Lowes</holder>
</copyright>
<legalnotice>
<para>Permission to use, copy, modify and distribute the ProFTPD
User Guide and its accompanying documentation for any purpose
and without fee is hereby granted in perpetuity, provided that
the above copyright notice and this paragraph appear in all
copies.</para>
</legalnotice>
<legalnotice>
<para>The copyright holders make no representation about the
suitability of this document for any purpose. It is provided
<quote>as is</quote> without expressed or implied
warranty.</para>
</legalnotice>
</bookinfo>
<dedication>
<para>This book is dedicated to Lady Kayla.</para>
</dedication>
<PREFACE ID="PREFACE"><?dbhtml filename="ch00.html">
<!--
<DOCINFO>
<PUBDATE>$Date$</PUBDATE>
<RELEASEINFO>$Revision$</RELEASEINFO>
</DOCINFO>
-->
<TITLE>Preface</TITLE>
<para>Welcome to this text on the ProFTPD server software, this
document grew out of a need for good documentation for the
software. ProFTPD was written as an Open source software project
released under the Gnu Public License (GPL). Many of the concepts
have been inspired by or derived from the Apache webserver
project.</para>
<para>This book grew out of a small FAQ on the proftpd.org website
prior to the change in maintainer in Sept 1999. The need for a
accurate and comprehensive FAQ as obvious, it rapidly became clear
that a simple FAQ would not be sufficient. In Oct 1999 I started
work on developing this document using the DocBook DTD in
conjunction with the jade.</para>
<para>The software is currently designed for the Unix operating
system and it's derivatives including Linux and the BSD variants.
It is also reported to compile under win32, however it has not
been designed for this environment.</para>
<SECT1>
<TITLE>This Book's Audience</TITLE>
<para>This text is primarily targeted at system administrators
who wish to make the most of the Proftpd software package. I
expect that most readers will have at least a grasp of the ftp
protocol and reasonable skills in compiling and maintaining a
live Unix based system. For a list of resources which I
consider to be useful reading to give this base knowledge
consult <XREF LINKEND="APP-RESOURCES">.</PARA>
<para>It is my hope, however, that the text is sufficiently
generic in approach that it will be of use to those simply
wishing to know more about ftp and the function of a typical ftp
server.</para>
<para>The later chapters go into more depth on complex
configurations and discuss the needs of a live server hosting
multiple virtual hosts and hopefully suggest ways in which to
keep the administration of these configurations to a manageable
scale.</para>
</SECT1>
<SECT1>
<TITLE>Why Read This Book?</TITLE>
<PARA>This book is designed to be the clear, concise, informative
reference to the Proftpd <ACRONYM>FTP</ACRONYM> server software,
I hope that this document will become the official documentation
for this software.</para>
<PARA>I hope to answer, all the questions you
might have about the issues concerning setting up and
configuring Proftpd and running the server software in the open
and sometimes hostile environment of the Internet. In
particular I cover the following subjects:</para>
<ITEMIZEDLIST>
<LISTITEM>
<PARA>How FTP operates, is defined and how it fits into
todays Internet.</para>
</LISTITEM>
<LISTITEM>
<PARA>How to configure a basic anonymous ftp server and a
basic user based ftp server.</para>
</LISTITEM>
</ITEMIZEDLIST>
</sect1>
<SECT1 ID="PREF-REQ-COMMENTS">
<TITLE>Request for Comments</TITLE>
<PARA>Please help me improve future editions of this book by
reporting any errors, inaccuracies, bugs, misleading or
confusing statements, and plain old typos that you find. An
online errata list is maintained at. Email your bug reports and
comments to us at <ULINK URL="mailto:[email protected]"
ROLE="online">[email protected]</ULINK>.</PARA>
</SECT1>
<sect1>
<TITLE>Organisation of This Book</TITLE>
<PARA>This book is divided into xxxmultiplexxx parts. <CITETITLE>Part I:
Introduction</CITETITLE> is an introduction to ftp, security and
your first ftp server:</para>
<VARIABLELIST>
<VARLISTENTRY>
<TERM><XREF LINKEND="CH-BACKGROUND"></TERM>
<LISTITEM>
<PARA>A quick introduction to FTP</PARA>
</LISTITEM>
</VARLISTENTRY>
</VARIABLELIST>
<para><CITETITLE>Part II: Configuration</citetitle> is a guide
to getting the server configured and running</para>
<VARIABLELIST>
<VARLISTENTRY>
<TERM><XREF LINKEND="CH-BACKGROUND"></TERM>
<LISTITEM>
<PARA>A quick introduction to FTP</PARA>
</LISTITEM>
</VARLISTENTRY>
</VARIABLELIST>
</sect1>
<sect1>
<title>Acknowledgements</title>
<para>Many thanks to the Proftpd developers, anyone who's posted
useful information to the mailing lists and everyone who has
mailed me direct.</para>
</sect1>
<sect1>
<title>Copyrights and Trademarks</title>
<para>This document may be reproduced in whole or in part,
without fee, subject to the following restrictions:</para>
<para>The copyright notice above and this permission notice must
be preserved complete on all complete or partial copies</para>
<para>Any translation or derived work must be approved by the
author in writing before distribution.</para>
<para>If you distribute this work in part, instructions for
obtaining the complete version of this manual must be included,
and a means for obtaining a complete version provided.</para>
<para>Small portions may be reproduced as illustrations for
reviews or quotes in other works without this permission notice
if proper citation is given.</para>
<para>Exceptions to these rules may be granted for academic
purposes: Write to the author and ask. These restrictions are
here to protect us as authors, not to restrict you as learners
and educators.</para>
</sect1>
</preface>
<PART ID="PROFTPD-INTRO">
<?dbhtml filename="part1.html">
<title>Introduction</title>
<chapter id="CH-BACKGROUND">
<?dbhtml filename="ch01.html">
<title>Background</title>
<sect1>
<title>What is Proftpd</title>
<para>ProFTPD is a ftp server primarily written for the various unix
variants though it will now compile under win32. It has been designed
to be much like Apache in concept taking many of the ideas
(configuration format, modular design, etc) from it.</para>
</sect1>
<sect1>
<title>Who codes/maintains Proftpd?</title>
<para>As with all Open source projects, no one person can really lay claim to
the entire package. The ProFTPD project was started by Floody who took
it to approximately 1.2.0pre2/3 before he found that his available time
was insufficient to handle this project as well as his other commitments.
From approximately mid-1999 MacGyver took over the project and pushed
it forward getting 1.2.0 out into the wild. From early 2002 TJ took
the reins of the project and started to get releases and new features
into the code.</para>
<para>There are also numerous people involved in developing modules and
documentation for the project. A number of these have been merged into
the core distribution and more are likely to follow.</para>
</sect1>
<sect1>
<title>Website & documentation</title>
<para>The official website for the project is
http://www.proftpd.org/, both should be a mirror of the
other.</para>
<para>The documentation is being brought back into shape at
the moment, the configuration on the website is reasonable but
the documentation supplied in the source should be considered
to be canonical. Even this is still being brought up to
date.</para>
</sect1>
<sect1>
<title>Bug reporting?</title>
<para>Bugs are best reported via the Bugzilla interface at
http://bugs.proftpd.org/</para>
</sect1>
<sect1>
<title>Mailing lists</title>
<para>There are three lists for ProFTPD</para>
<sect2>
<title>Announce</title>
<para>
[email protected]</para>
<para>This is a very low traffic list where only ProFTPD announcements/changes
will be announced.</para>
<para>Subscribe by sending a message to
[email protected] with "subscribe" in the
subject.</para>
</sect2>
<sect2>
<title>Users</title>
<para>[email protected]</para>
<para>This is intended to the the user support channel for
the software, in most likelihood this is going to be a high
traffic list and slightly chatty. Please read the FAQ, the
documentation and the list archives before posting a
question.</para>
<para>Subscribe by sending a message to
[email protected] with "subscribe" in the
subject.</para>
</sect2>
<sect2>
<title>Development</title>
<para>[email protected]</para>
<para>This list is intended for discussion of
development-related issues of ProFTPD, and feature design.
It is NOT intended to be a 'user help' group.</para>
<para>Subscribe by sending a message to
[email protected] with 'subscribe' in the
subject.</para>
</sect2>
</sect1>
<sect1>
<title>Copyright Issues</title>
<para>The Proftpd software is currently distributed under the
GNU General Public License (version 2 or later) as published
by the Free Software Foundation. Copyright is held by Public
Flood Software.</para>
</sect1>
<sect1>
<title>The FTP protocol</title>
<para>FTP was defined initially in RFC959 and has been updated
in RFC2228. The protocol pre-dates RFC959 by over a decade
during which time various RFC's were written to move the
protocol towards a clear stable standard. This standard has
now served the Internet well for fourteen years and shows only
minor signs of it's age. RFC2228 currently only has standards
track status but shows all the signs of becoming a full IETF
standard for the internet. This new RFC extends the protocol
to include encrypted and authenticated connections and to
provide methods of assurance of data integrity. Proftpd is
RFC959 compliant and there are plans to make it RFC2228
compliant in version 1.4 and later.</para>
<para>The File Transfer Protocol (FTP) does exactly what it
says, it allows the movement of files from one place to
another. Like most of the services on the internet it's
designed round the client-server model. Given this software
related to ftp can be split along these lines, Proftpd is a
ftp server.</para>
<para>FTP servers allow access by authenticating users against
a password database of some description. Historically this
has been the unix /etc/passwd file (and later /etc/shadow)
more recently support for other authentication systems as been
provided including NIS, Radius, SQL, LDAP and many others.
For most servers the username and password are sent over the
network in plain-text. There is a RFC defining the
specification for encrypted passwords for use with ftp servers
but this not had a widespread takeup.</para>
<sect2>
<title>Anonymous Servers</title>
<para>In addition to properly authenticated users there ftp
has historically allowed a special class of user. The
"anonymous" connection, primarily used for public archives
of data, programs or general "stuff" anonymous logins allow
anyone on the network to connect to a server. Normally
anonymous connections are limited in number to prevent the
free aspect to the server from overwhelming it's primary
function and the access permissions and rights of the
anonymous user are locked down.</para>
<para>Anonymous servers are one of the great resources of
the Internet, over the years they collectively have become a
massive redundant public storage system for information and
programs. This is partly due to the open nature of many
admins in what they will allow to be hosted and partly in
the habit of "mirroring" other sites to spread the load.
Without anonymous servers it's unlikely that the Open Source
community would have been able to achieve the critical mass
and accessibility required for it's current success.</para>
</sect2>
<sect2>
<title>Sockets and ports</title>
<para>FTP was designed round a two socket model, streaming
data down one socket and control information down the other.
This design makes it possible for a well designed client to
be uploading and downloading while still permitting the user
to perform other administrative tasks on the server.</para>
<para>
Normally the control socket uses port 21 (ftp) at the
server end, the data socket handling is more complex. Two
modes of operation are defined for ftp connections.
</para>
<sect3>
<title>Active</title>
<para>Active mode connections run control over port 21 and
allow the server to decide which socket to use locally
for data traffic.
</para>
</sect3>
<sect3>
<title>Passive</title>
<para>
Passive Mode connections work the same way as normal
(Active Mode) connections, except the data connection is
also made from the client to the server. This avoids the
problem of incoming data connections being blocked by
the firewall by making both connections from the
client. </para>
</sect3>
<sect3>
<title>Problems</title>
<para>Unfortunately, not all FTP clients are capable of
passive mode transfers, and not all users are aware of
their existence or the problems they solve. Some
firewalls can be configured to allow incoming FTP data
connections while blocking all other incoming TCP
connections. (The firewall recognises FTP data
connections because they originate from port 20, the FTP
data port). This allows Active Mode FTP transfers
through the firewall without blocking the incoming FTP
data connections. Support for port connections
established on the traditional FTP data port (20) was
added in Rumpus 1.2, so older versions of Rumpus will
not work correctly with firewalls configured this
way.</para>
<para>Passive Mode connections work the same way as normal
(Active Mode) connections, except the data connection is
also made from the client to the server ie made to port
ftp-data (20). This avoids the problem of incoming data
connections being blocked by the firewall by making both
connections from the client. What it boils down to is
Active control channel, port 21 data channel, server
specifies random port. Passive control channel, port 21
data channel, port 20 I guess it's doc time :)
</para>
</sect3>
</sect2>
</sect1>
</chapter>
<chapter id="install">
<title>Compilation and installing</title>
<para>Being Open Source code Proftpd is available primarily as
source code for local compilation. There are a number of
maintainers within the project who create the packaged builds
for the primary platforms and distributions. For most users the
packaged builds will prove to be sufficient and the least hassle
route to installing Proftpd. However to use the daemon to it's
fullest or to explore some of the more interesting features a
local custom build will be required.</para>
<sect1>
<title>Architecture</title>
<para>Proftpd was designed from the ground up to be both
extensible and as secure by design as possible. Security is
discussed in depth later in this document, however while there
are no known security holes it cannot be said of this or any
other piece of software that there are no problems waiting to
be found. The extensibility is provided by means of a modular
architecture which takes many lessons and features from the
Apache webserver project. Almost all the functionality has
been supplied by moving most functions into modules. This
includes features such as "ls" and the authentication
handling, this approach allows third party developers to
provide additional modules to latch onto these hooks to add or
extend the basics provided. Most of the more interesting
modules have to be compiled in as they are not part of the
standard builds. Unfortunately dynamically loadable modules
are not available within the 1.2.x code tree though
development and testing is planned for the 1.3.x development
branch.</para>
</sect1>
<sect1>
<title>Installing packaged versions</title>
<sect2>
<title>Linux (RPM)</title>
<para>The Linux RPM package is available on the main
distribution sites for Proftpd. Installation is as simple as
<prompt>rpm --install proftpd-{version}.rpm</prompt>
</para>
<para>Note: check multiple rpm route now supported.</para>
</sect2>
<sect2>
<title>Linux (DEB)</title>
<para>The Debian package is equally as simple to install as
the RPM with either
<programlisting>
dpkg --install {debfile}
or
apt-get install proftpd
</programlisting>
</para>
</sect2>
<sect2>
<title>FreeBSD</title>
<para>Does anyone have any comments on the BSD install?</para>
</sect2>
</sect1>
<sect1>
<title>Compiling from source</title>
<sect2>
<title>Supported Platforms</title>
<para>Proftpd is reported to compile and function on the
following platforms,</para>
<programlisting>
Linux 2.0.x & 2.2.x (glibc 2.x only), 2.4.x
BSDI 3.1 & 4.0
IRIX 6.2, 6.3, 6.4, 6.5
Solaris 2.5.1, 2.6 & 2.7, 8, 9
AIX 3.2, 4.2, 4.3.3
OpenBSD 2.2/2.3
FreeBSD 2.2.7, 3.x, 4.x, 5.0
Digital UNIX 4.0A, 5.1A, 5.1B
DEC OFS/1
UnixWare 7
SCO OpenServer 5.0.5
</programlisting>
<para>Some platforms require that compilation is done with
gcc (or one of it's variants) while other platforms only
function properly if compiled with the compiler shipped with
the OS. Experiences vary and at this time there is no
reliable list of which platform requires what.</para>
<sect3>
<title>FreeBSD</title>
<para>ProFTPD is part of the FreeBSD ports collection. The minimal install
commands on a system with a properly installed ports tree are:</para>
<literallayout>
cd /usr/ports/ftp/proftpd
make install
</literallayout>
<para>More information can be found in the README.html file in the same
directory.</para>
</sect3>
</sect2>
<sect2>
<title>Including additional modules</title>
<para>Only the essential core modules are compiled in by
default, most of the more interesting features such as sql
support, upload/download ratios etc etc are contained within
the non-standard modules.</para>
<para>Including additional modules is only possible at
compile time, at the moment there is no chance of
dynamically loadable modules entering the 1.2.x code tree.
This is primarily due to time and the need for some major
structural changes within the code to support dynamically
loadable modules.</para>
<example>
<title>Configuring for additional modules</title>
<programlisting>
./configure --with-modules=mod_module1:mod_module2
make
make install
</programlisting>
</example>
</sect2>
</sect1>
<sect1>
<title>Compatibility Issues</title>
<para>
sendfile
bsd
linux 2.2 vs 2.0
mod_linuxprivs
libc5
</para>
</sect1>
<sect1>
<title>linux</title>
<para></para>
<sect2>
<title>Why not libc5 on Linux?</title>
<para>There are several known problems with libc5-based
systems, including improperly implemented library routines
(vsprintf and vsnprintf are examples). There are known
problems with the resolver library. For these reasons and
others lib5 is not being supported at all, the latest
versions of the major distributions (inc Debian, Redhat
and Suse) are all glibc.</para>
</sect2>
</sect1>
<sect1>
<title>CVS</title>
<para>CVS (Concurrent Versions System), is a version control
system which allows multiple developers (scattered across
the same room or across the world) to maintain a single
code base and keep a record of all changes to the
work.</para>
<para>The CVS repository for ProFTPD is available for
non-developers in read-only mode, however this code is right
on the bleeding edge and is not guaranteed to even compile
let alone work. Access to CVS is given to allow important
security patches out into the wild and to allow users and
interested users to test out the latest changes on real
systems.</para>
<sect2>
<title>Recommended ~/.cvsrc settings</title>
<informalexample>
<programlisting>
cvs -z 3
update -Pd
diff -u
</programlisting>
</informalexample>
</sect2>
<sect2>
<title>Where can I get information on cvs?</title>
<para>CVS is produced by Cyclic Software
(http://www.cyclic.com/) and details on CVS can be found
on their website. The CVS documentation is clear,
detailed and above all heavy when printed. I'd recommend
reading it if you're planning on using CVS a lot.</para>
</sect2>
</sect1>
<sect1>
<title>How do I get debug output</title>
<para>The easiest way is to fire up proftpd manually from the
command line with the debug level cranked up.
/usr/local/sbin/proftpd -d9 -n</para>
<para>This will result in maximal debug output direct to the
console. Warning, this can get messy on a busy server, for
testing I would suggest copying the config and altering the
port the server binds to and then testing.</para>
</sect1>
<sect1>
<title>Patches</title>
<para>Any patches should be submitted in Universal format,
this makes integrating them into the main cvs source a lot
easier. When generating a diff against the current cvs source
use "cvs diff -u" to generate the patch.
cvs diff -u filename > filename.patch
or
cvs diff -u > bigger.patch
</para>
<para>Patches that add configuration directives without proper
documentation. Will be rejected. New features without
documentation are less than useless to the community at
large.</para>
</sect1>
<sect1>
<title>Using non-default modules</title>
<para>Simply configure ProFTPD with
./configure --with-modules=mod_module1:mod_module2:mod_module3
make
make install
</para>
</sect1>
<sect1>
<title>Plans for next version (1.3.x)</title>
<para>The new development series will be 1.3.x, using the same
number scheme as the linux kernel developers. The
targets/goals are:
refining/redefining the module API to make it more extensible and useful.
dynamic modules
security APIs and implementations
mod_ls rewrite
Implementing some security-related RFCs
Creating a web and GUI configuration interface to ProFTPD.
</para>
<para>1.4.x will be the production release of the 1.3.x
development set.</para>
</sect1>
<sect1>
<title>Longer term development</title>
<para>For 1.9.x/2.0.x there are plans to completely recode
some core sections of the software and creating an abstract
layer to build the 2.x version on. The abstract layer will
handle all filesystem and OS-specific stuff. This layer will
then have backends onto the major environments (ie Unix and
NT)</para>
</sect1>
<sect1>
<title>NT Support</title>
<para>If/when a port is undertaken for NT, it will only be
after a near complete rethinking of ProFTPD. This is planned
for 2.0 and onwards.</para>
</sect1>
<sect1><title>New features/modules</title>
<para>While anything new is welcomed it's probably better to
at least float the idea first on the devel mailing list to
ensure that someone else isn't already hacking on it. Also
when submitting the patch or module for inclusion into the
ProFTPD source full documentation is needed.</para>
<sect2>
<title>Suggestions made for future development</title>
<para>
GUI based configuration tool
</para>
</sect2>
</sect1>
</chapter>
<chapter id="security">
<title>Security Issues</title>
<para>As with all services there is the risk that abuse can
happen or that a crack attempt will be made on the hosting
server. As a general rule crackers will attempt to break in
through known holes in the various server daemons
running.</para>
<para>The cautious and security conscious system admin should be
aware of the two main avenues for abuse, external and internal.
I will consider external attacks to be those made by individuals
without valid accounts or "user" level access to the server.
Internal I will consider as being those individuals with
authenticated user access of some form to the server.</para>
<para>Server Security security holes weak passwords Abuse of
server warez dumping ground</para>
<sect1>
<title>Securing ftp servers</title>
<para>In general there is not much more to securing a ftp
server than there is to any other public access server.
However the twin socket design and thus the requirement to
never quite give up root privileges completely leaves a window
ajar for the competent cracker to climb through. Or
occasionally a thumping great sign and open door for a script
kiddie with some time to spare.</para>
<para>Proftpd provides for some additional security by it's use
of chroot(), user and IP access limits, command and path
filters to limit what and where files can be uploaded and it's
attention to when root privs are needed and when they are not.
However a buffer overflow in the wrong place and it's possible
that the server is compromised beyond hope.</para>
<para>Simple steps which can be taken to tighten security
include</para>
<itemizedlist mark=opencircle>
<listitem><para>Log to a separate machine</para></listitem>
<listitem><para>Traffic filtering upstream of the server</para></listitem>
<listitem><para>chroot() all sessions</para></listitem>
<listitem><para>Don't give a valid shell where it's not needed</para></listitem>
<listitem><para>Run an intrusion detection system</para></listitem>
<listitem><para>If possible place the OS itself on a bootable CDrom</para></listitem>
<listitem><para>Tripwire</para></listitem>
<listitem><para>Decent backups</para></listitem>
</itemizedlist>
</sect1>
<sect1>
<title>Daemon security</title>
<para>Recently (between versions 1.2.0pre3 - 1.2.0pre7) there
have been a number of buffer overflow type security problems
with ProFTPD, with the coming release of pre7 these should be
under control. Though no absolute statement can be given on
the security of the software (this is true for every piece of
software out there). A significant amount of effort has been
put into removing the more 'dangerous' system calls which are
prone to overflow attacks.</para>
<para>There is a known security problem with ALL unix FTP
daemons, which requires the daemon to retain root privileges
even after a client has fully authenticated. In ProFTPD
versions 1.0.x, a decision was made to ignore RFC959's port 20
requirements in the interests of security. This approach has
now been abandoned in favour of a more rfc compliant
approach.</para>
<para>ProFTPD takes a middle road in terms of security. It
only uses root privileges where required and drops to the UID
defined in the config file at all other times. Times when
root is required include, binding to ports < 1024, setting
resource limits, reading configuration information and some
network code.</para>
</sect1>
<sect1>
<title>Password Issues</title>
<para>One of the biggest security problems about the whole FTP
protocol is the need to have the password transmitted in clear
text across the network. In effect the username and passowrd
pair are available at all times during the authentication
sequence, resulting in this information being available to
crackers and sniffers alike.</para>
<sect2>
<title>Encrypted passwords</title>
<para>Currently (as of 1.2.0pre9) Proftpd does not support
encrypted passwords for authentication. Development for
this feature is scheduled for post 1.2.0rel1, and it will
remove the absolute need to send the password in clear text
over the network. There are some additional approaches
involving ssh (secure shell) which I will not cover in
detail in this text which can be used to secure a ftp
session without encrypted keys.</para>
</sect2>
<sect2>
<title>FTP as root</title>
<para>This is a bad idea simply because it's a major
security risk to send the root passowrd in clear text over
any network. If there is a need to get files onto a server
there are always better ways of achieving it than connecting
via ftp as root.</para>
<example>
<title>Other approaches</title>
<itemizedlist mark=opencircle>
<listitem><para>rcp</para></listitem>
<listitem><para>ssh/scp</para></listitem>
<listitem><para>ftp as a safe user and change the ownership later.</para></listitem>
</itemizedlist>
</example>
<para>If you really must ftp as root then our thoughts go
with you on this dangerous journey as you add "RootLogin on"
to your proftpd configuration and may your god go with
you.</para>
</sect2>
</sect1>
<sect1>
<title>Server attacks</title>
<para>As with all server processes the primary method of
cracking remains the buffer overflow. Due to the nature of
the protocol and the requirement for root level privileges
this leaves ftp daemons open to attack. Buffer overflows are
the result of weak programming where boundary condition checks
have been skipped or "unsafe" system calls have been used.
These allow a fixed length storage area to be overflowed, this
overflow can then be used as the transport to allow the
execution of arbitary commands as the root user. In
combination this is known as a "root exploit".</para>
<sect2>
<title>Stack smashing protection</title>
<sect3>
<title>What about using Stackguard?</title>
<para>Stackguard is a gcc variant which can protect
programs from stack-smashing attacks, programs compiled
using Stackguard dies without executing the stack code.
While this approach is a good first line of defense
against future problems it's not a complete cure-all.
Some of the buffer overflows were found on static
variables, which are not protected by stack protection
mechanisms. </para>
</sect3>
<sect3>
<title>Libsafe</title> <para>Libsafe implements a
'middleware' layer which sits between the OS and the
daemon process and protects against buffer overflows.
This is achieved by intercepting all calls known to be
vulnerable to overflow.
http://www.bell-labs.com/org/11356/html/security.html</para>
</sect3>
</sect2>
<sect2>
<title>Running Proftpd as non-root</title>
<para>Running ProFTPD as a non-root user gives only a
marginal security improvement on the normal case and adds
some functional problems. Such as not being able to bind to
ports 20 or 21, unless it's spawned from inetd. The
inability to bind to ports 20 and 21 makes this approach
useless for commercial hosting environments where the
customers are expecting the connection to be on a "standard"
port.</para>
</sect2>
<sect2>
<title>Linux</title>
<para>For Linux 2.2.x kernel systems there is the POSIX
style mod_linuxprivs module which allows very fine grain
control over privileges. This is highly recommended for
security-conscious admins.</para>
</sect2>
</sect1>
<sect1>
<title>Firewall issues</title>
<para>Generally ftp and firewalls are quite capable of
co-existing on the same or separate networks with the minimum
of fuss. The source of problems stem from the fundamental
design of ftp and it's twin socket approach to data transfer.
Firewalls, good ones at least, approach security by assuming
everything is hostile and then starting to open up holes to
trusted ports and destinations.</para>
<para>FTP, as has been mentioned in an earlier chapter has two
main methods of operation, passive and active. Passive mode
support is difficult in the extreme to support within a
firewall, it requires the tracking of port 21 connections in
and outbound and opening up complete tcp holes for that
connection on the fly and tearing down once the control socket
is closed. Active support is brainlessly simple by
comparison, opening ports 20 and 21 is sufficient, nothing
more complex is required.</para>
<sect2>
<title>ProFTPD behind a firewall</title>
<para>Due to the multiple socket and semi-random port assignment nature of
the ftp protocol Because of the bi-socket nature of the ftp protocol
additional care must be taken when setting up ProFTPD behind a
firewall. Setting the firewall to allow the control socket through is
easy enough, allow tcp packets destined for port 21 on the target
server. However the data socket in passive mode may be targetted on a
random port number on the server side resulting in either a highly
complex or very weak firewall. The PassivePorts directive allows the
admin to specify the range of ports the server will use to service
ftp-data connections, this range can then be configured on the
firewall.
</para>
</sect2>
</sect1>
<sect1>
<title>Security by obscurity and warnings</title>
<para>Good security practice works on a combination of locking
down all the holes as tightly as possible and letting as
little information about the network out as possible.
Additionally some legal systems require that explicit warnings
are put up letting the casual connecting host know that
unauthorised access is not permitted. To provide these
features Proftpd supplies a number of directives which control
the message presented to the user.</para>
<sect2>
<title>How can I prevent the server version from being displayed</title>
<para>Setting SeverIdent to "off" should turn off the
information about what type of server is running. To have
maximum effect this directive should either be in the Global
context or included in every virtual host block and the