Escolar Documentos
Profissional Documentos
Cultura Documentos
com
Since this setup uses one FTP account to create user home directories and upload
files, a compromise to this FTP user would cause the attacker to gain access to
all FTP user home directories. I guess it just depends on how much you trust the
DefaultRoot directive in Proftpd. I run Proftpd in its own chroot environment in
addition to using DefaultRoot, so I’m used to feeling pretty safe with my Proftpd
install. Anyway, here’s how I did the install/configuration
cd /usr/ports/ftp/proftpd-mysql/
env WITH_QUOTA=yes make
env WITH_QUOTA=yes make install
2. Add the global proftpd user & Proftpd group to your system.
I used uid & gid 5500 simply because that’s what was used at one of the sites I
was referencing (listed below).
) ;
(assumes /home/ftp is where you keep your ftp users. Otherwise, change the homedir
location). This is certainly not a necessary step, but you should probably check
to see if your configuration is working. You can delete this user later.
6. Set your proftpd configuration to use the mySQL authentication and quotas:
(NOTE: this is not a complete configuration file, it’s basically just the default
config file with mySQL auth & quotas added, but note that the User and Group
directives are the user & group we added in step 2. )
MaxInstances 30
# Set the user and group under which the server will run.
User proftpd
Group Proftpd
DenyAll
# Here we tell ProFTPd the names of the database columns in the "usertable"
# we want it to interact with. Match the names with those in the db
SQLUserInfo proftpdUsers userName passwd uid gid homedir shell
# Here we tell ProFTPd the names of the database columns in the "grouptable"
# we want it to interact with. Again the names match with those in the db
SQLGroupInfo proftpdGroups groupName gid members
# set min UID and GID - otherwise these are 999 each
SQLMinID 5000
#============
# User quotas
# ===========
QuotaEngine on
QuotaDirectoryTally on
QuotaDisplayUnits Mb
QuotaShowQuotas on
SQLNamedQuery insert-quota-tally INSERT "%{0}, %{1}, %{2}, %{3}, %{4}, %{5}, %{6},
%{7}" proftpdQuotaTallies
QuotaLimitTable sql:/get-quota-limit
QuotaTallyTable sql:/get-quota-tally/update-quota-tally/insert-quota-tally