#
# proftpf.conf
#
ServerName "FTPD"
ServerType standalone
Port 21
Bind 192.168.215.10
# some basic defaults
TimeoutLogin 120
TimeoutIdle 180
TimeoutNoTransfer 360
TimeoutStalled 650
MaxInstances 30
RequireValidShell off
AuthPam off
AuthPamConfig ftp
# some runtime files and logs
PidFile /var/run/proftpd/proftpd.pid
LogFormat default "%h %l %u %t \"%r\" %s %b"
LogFormat auth "%v [%P] %h %t \"%r\" %s"
LogFormat write "%h %l %u %t \"%r\" %s %b"
SyslogLevel notice
UseReverseDNS off
User proftpd
Group proftpd
# limitations
MaxClients 20 "There are many connections with server"
MaxClientsPerHost 3 "%m clients are connected from your host, more not permited"
MaxLoginAttempts 3 "There are many attempts to login"
# Messages
DisplayConnect /etc/ftp_connect.msg
DisplayLogin /etc/ftp_login.msg
AccessDenyMsg "ACCESS DENY"
AccessGrantMsg "ACCESS GRANT"
DisplayGoAway "Go Away"
#
# Global settings
#
<Global>
# Sequring of server
ServerIdent on "Welcome to the FTP server. Please login."
IdentLookups off
DeferWelcome on
PassivePorts 49152 65534
DefaultRoot ~
SQLAuthTypes Plaintext Crypt
SQLAuthenticate users* groups*
SQLConnectInfo ftpdb@127.0.0.1 ftpdb PaSwOrD_to_DB
SQLUserInfo ftpuser userid passwd uid gid homedir shell
SQLGroupInfo ftpgroup groupname gid members
SQLMinID 500
SQLHomedirOnDemand on
SQLLog PASS updatecount
SQLNamedQuery updatecount UPDATE "count=count+1, accessed=now() WHERE userid='%u'" ftpuser
SQLLog STOR,DELE modified
SQLNamedQuery modified UPDATE "modified=now() WHERE userid='%u'" ftpuser
#
# User quotas
#
QuotaEngine on
QuotaDirectoryTally on
QuotaDisplayUnits Mb
QuotaShowQuotas on
SQLNamedQuery get-quota-limit SELECT "name, quota_type, per_session, limit_type, bytes_in_avail, bytes_out_avail, bytes_xfer_avail, files_in_avail, files_out_avail, files_xfer_avail FROM ftpquotalimits WHERE name = '%{0}' AND quota_type = '%{1}'"
SQLNamedQuery get-quota-tally SELECT "name, quota_type, bytes_in_used, bytes_out_used, bytes_xfer_used, files_in_used, files_out_used, files_xfer_used FROM ftpquotatallies WHERE name = '%{0}' AND quota_type = '%{1}'"
SQLNamedQuery update-quota-tally UPDATE "bytes_in_used = bytes_in_used + %{0}, bytes_out_used = bytes_out_used + %{1}, bytes_xfer_used = bytes_xfer_used + %{2}, files_in_used = files_in_used + %{3}, files_out_used = files_out_used + %{4}, files_xfer_used = files_xfer_used + %{5} WHERE name = '%{6}' AND quota_type = '%{7}'" ftpquotatallies
SQLNamedQuery insert-quota-tally INSERT "%{0}, %{1}, %{2}, %{3}, %{4}, %{5}, %{6}, %{7}" ftpquotatallies
QuotaLimitTable sql:/get-quota-limit
QuotaTallyTable sql:/get-quota-tally/update-quota-tally/insert-quota-tally
RootLogin off
RequireValidShell off
# Logging
TransferLog /var/log/proftpd/xfer.log
ExtendedLog /var/log/proftpd/access.log WRITE,READ write
ExtendedLog /var/log/proftpd/auth.log AUTH auth
ExtendedLog /var/log/proftpd/paranoid.log ALL default
# optimization of servers
DeleteAbortedStores on
HiddenStor on
AllowStoreRestart on
AllowRetrieveRestart on
AllowOverwrite on
# need patch koi8-r to cp1251
#CharsetLocal KOI8-R
#CharsetRemote CP1251
</Global>
DefaultServer on
<Anonymous /mnt/ftp>
User ftp
Group ftp
UserAlias anonymous ftp
MaxClients 20 "Sorry, max users -- try again later"
# Hide all files owned by root
HideUser root
HideGroup root
#Allow logins if they disabled above
<Limit LOGIN>
Order allow,deny
Allow from 127.0.0.1
Allow from 192.168.215.0/24
Deny from all
</Limit>
<Directory *>
<Limit WRITE DELE STOR MKD RMD>
DenyAll
</Limit>
</Directory>
# upload directory
<Directory incoming>
UserOwner ftp
GroupOwner ftp
Umask 0117 0007
# Limitation for incoming dir
<Limit DELE READ STOR MKD RMD>
AllowAll
</Limit>
</Directory>
</Anonymous>
Всех остальных юзверей держу в postgres где указываю домашнюю директорию, квоты, пароль и тд.