{{anchor href="top"}}
Hits : **{{hits}}**
== Proftpd Mail Server :: Mini How To ==
{{ToC from="h2" to="h3"}}
=== Proftpd ===
http://www.proftpd.org
http://www.proftpd.org/docs/
Highly configurable GPL-licensed FTP server software
((#top))
-----------
=== Install ===
1.3.3c [29/Oct/2010]
%%(code)
# wget -c ftp://ftp.proftpd.org/distrib/source/proftpd-1.3.3c.tar.bz2
# tar jxvf proftpd-1.3.3c.tar.bz2
# cd proftpd-1.3.3c
# ./configure
# make
# make install
%%
((#top))
-----------
=== Config ===
** /usr/local/etc/proftpd.conf **
%%
ServerName "ProFTPD Default Installation"
ServerType standalone
DefaultServer on
Port 21
UseIPv6 off
Umask 022
MaxInstances 30
User nobody
Group nogroup
AllowOverwrite on
<Limit SITE_CHMOD>
DenyAll
</Limit>
<Anonymous ~ftp>
User ftp
Group ftp
UserAlias anonymous ftp
MaxClients 10
DisplayLogin welcome.msg
DisplayChdir .message
<Limit WRITE>
DenyAll
</Limit>
</Anonymous>
%%
((#top))
-----------
To verify that our configuration file is valid, we simple run:
%%
proftpd -t
%%
for example in my archlinux box:
%%
# proftpd -t
Checking syntax of configuration file
- Fatal: Group: Unknown group 'nogroup' on line 30 of '/usr/local/etc/proftpd.conf'
%%
so i should fix it:
%%
# sed -r -i 's/(nobody|nogroup)/ftp/' /usr/local/etc/proftpd.conf
%%
%%
# proftpd -t
Checking syntax of configuration file
Syntax check complete.
%%
=== Run ===
Simple we just run (you must be root) :
%%(code)
# proftpd
%%
%%(code)
ps -ef | grep pro[f]tpd
%%
or even better:
%%
pgrep proftpd
%%
((#top))
-----------
=== Debug ===
Before you start your proftpd installation, you should first debug proftpd to catch common errors:
%%
# proftpd -n -d 1
%%
Check your modules:
%%
# proftpd -l
%%
View all your settings:
eg. (in my linux box):
%%(html)
# proftpd -V
Compile-time Settings:
Version: 1.3.2a (maint)
Platform: LINUX
Built: Τρι 08 Σεπ 2009 09:17:10 μμ EEST
Built With:
configure
CFLAGS: -O2 -Wall
LDFLAGS: -L$(top_srcdir)/lib
LIBS: -lcap -lpam -lsupp -lcrypt
Files:
Configuration File:
/usr/local/etc/proftpd.conf
Pid File:
/usr/local/var/proftpd.pid
Scoreboard File:
/usr/local/var/proftpd/proftpd.scoreboard
Features:
- Autoshadow support
- Controls support
+ curses support
- Developer support
- DSO support
+ IPv6 support
+ Largefile support
- Lastlog support
+ ncurses support
- NLS support
- OpenSSL support
- POSIX ACL support
+ Shadow file support
+ Sendfile support
+ Trace support
Tunable Options:
PR_TUNABLE_BUFFER_SIZE = 1024
PR_TUNABLE_GLOBBING_MAX = 8
PR_TUNABLE_HASH_TABLE_SIZE = 40
PR_TUNABLE_NEW_POOL_SIZE = 512
PR_TUNABLE_SCOREBOARD_BUFFER_SIZE = 80
PR_TUNABLE_SCOREBOARD_SCRUB_TIMER = 30
PR_TUNABLE_SELECT_TIMEOUT = 30
PR_TUNABLE_TIMEOUTIDENT = 10
PR_TUNABLE_TIMEOUTIDLE = 600
PR_TUNABLE_TIMEOUTLINGER = 30
PR_TUNABLE_TIMEOUTLOGIN = 300
PR_TUNABLE_TIMEOUTNOXFER = 300
PR_TUNABLE_TIMEOUTSTALLED = 3600
PR_TUNABLE_XFER_SCOREBOARD_UPDATES = 10
%%
((#top))
-----------
=== Verify ===
%%(html)
> ftp localhost
Connected to localhost.
220 ProFTPD 1.3.1 Server (ProFTPD Default Installation) [127.0.0.1]
Name (localhost:ebal): anonymous
331 Anonymous login ok, send your complete email address as your password
Password:
230 Anonymous access granted, restrictions apply
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> ls
200 PORT command successful
150 Opening ASCII mode data connection for file list
drwxr-xr-x 37 nobody nogroup 4096 Oct 11 13:08 pdf
drwxr-xr-x 5 nobody nogroup 4096 Oct 7 14:44 mp3
226 Transfer complete
ftp>
%%
((#top))
-----------
=== Virtual Users ===
O proftpd ftp server έχει την δυνατότητα να υποστηρίζει virtual users. Αυτό μας δίνει την δυνατότητα για 2 πράγματα:
1. Όταν έχουμε πραγματοποιήσει εγκατάσταση σε ένα chroot περιβάλλον
2. Όταν θέλουμε να υποστηρίζουμε πολλαπλά virtual host και πολλαπλούς χρήστες χωρίς να χρειάζεται να "πειράζουμε" το σύστημά μας.
Η προσθήκη χρηστών είναι εξαιρετικά εύκολη και απλή, απλά χρειάζεται να δημιουργήσουμε με το πρόγραμμα ftpasswd,
που βρίσκεται εντός του λογισμικού μας, ένα παρόμοιο αρχείο με το /etc/passwd.
Παράδειγμα χρήσης:
%%(code)
ftpasswd --passwd --name ftpuser --home=/tmp/ --shell=/bin/bash --uid=10001
%%
Θα μας ζητήσει να δώσουμε το συνθηματικό του χρήστη και θα παράγει ένα αρχείο: **ftpd.passwd**
Τώρα το μόνο που μένει είναι να δηλώσουμε στο αρχείο ρυθμίσεων του proftpd μας το αρχείο με την ακριβή του διαδρομή.
Με λίγα λόγια προσθέτουμε μία γραμμή στο **proftpd.conf** ως εξής:
%%(code)
AuthUserFile /usr/local/etc/ftpd.passwd
%%
Και επανεκκινούμε τον proftpd
((#top))
-----------