Network: FTP server: ProFTPd and how to install it...

(last edit: 2001-03-08) This document is about replacing the standard ftpd from the FreeBSD kernel with the fancier ProFTPd. Ok, here we go: * First install it from /usr/ports/ftp/proftpd If you want to use the UseHostsAllow directive you will need to make it using: make --with-modules=${MODULES} * Next we'll want it to run from inetd, because this way it (easily) gets booted at systemboot. To do this edit your /etc/inetd.conf And alter it to look like this: ---------------------------------------------------------------------------- #ftp stream tcp nowait root /usr/libexec/ftpd ftpd -l ftp stream tcp nowait root /usr/local/libexec/proftpd proftpd ---------------------------------------------------------------------------- Because we're starting ProFTPd from inetd. Your ProFTPd (to be found in: /usr/local/etc) config file will need the extra line of: ---------------------------------------------------------------------------- ServerType inetd ---------------------------------------------------------------------------- * With this done ProFTPd will boot when your system is started. (If you've just installed and want to start it without rebooting kill -HUP your inetd process.) Footnote: Anonymous access is off by default (good thing(tm)) If you want it on edit your /usr/local/etc/proftd.conf ============================================================================== The next part will cover adding ratio's for users. * This is basically how the ratio's work. Just figure out what you'll need and put that into your proftpd.conf: ---------------------------------------------------------------------------------- The ratio directives take four numbers: file ratio, initial file credit, byte ratio, and initial byte credit. Setting either ratio to 0 disables that check. The directives are HostRatio (matches FQDN, wildcards allowed), AnonRatio (matches password entered at login), UserRatio (accepts "*" for 'any user'), and GroupRatio. Ratios on # enable module UserRatio ftp 0 0 0 0 HostRatio master.debian.org 0 0 0 0 # leech access (default) GroupRatio proftpd 100 10 5 100000 # 100:1 files, 10 file cred 5:1 bytes, 100k byte cred AnonRatio billg@microsoft.com 1 0 1 0 # 1:1 ratio, no credits UserRatio * 5 5 5 50000 # special default case ----------------------------------------------------------------------------------- * To make it complete, here is my entire config file (/usr/local/etc/proftpd.conf) ---------------------------------------------------------------------------------- # To have more informations about Proftpd configuration # look at : http://www.proftpd.org/ ServerName "mammoet.t-l.org ftp archive" ServerType inetd DefaultServer on ServerIdent off ScoreboardPath /var/run # Limit the amount of logins. MaxClients 4 MaxClientsPerHost 1 "You may only connect once, do not abuse this facility!" # MaxClientsPerUser 2 "Maximum numer of connections for this user reached" MaxLoginAttempts 3 # Display messages while logging in. DisplayConnect /etc/ftp_connect.msg DisplayLogin /etc/ftp_login.msg # Specify from which ip's connections are allowed/denied # UseHostsAllowFile /etc/proftpd.allow # UseHostsDenyFile /etc/proftpd.deny # Set timelimits TimeoutIdle 60 TimeoutLogin 30 TimeoutNoTransfer 300 TimeoutStalled 120 # Limit the download speed to 200KB after ~15MB has been downloaded RateReadBPS 204800 #RateReadFreeBytes 1500000 RateReadHardBPS on # Chroot certain groups to certain dirs DefaultRoot / wheel DefaultRoot /ftp users Port 21 Umask 022 # Set ratio's for groups. #Ratios on #GroupRatio wheel 0 0 0 0 #GroupRatio users 0 0 5 0 # Set the user and group that the server normally runs at. User nobody Group nogroup # Normally, we want files to be overwriteable. AllowOverwrite on ---------------------------------------------------------------------------------- Have fun! Thats an order soldier Sjoerd Send your questions to: I.dont.get.it@t-l.org

Click here to go back to the index.