It’s very helpful to use the mysql authentification for proftpd. Especially if you manage a quite number of users. So you’re able to use a central database which manages the accounts.

First thing you need is an appropriate mysql schema that belongs your needs. This is my example:
CREATE TABLE ftp_users (
username varchar(60) binary default NULL,
uid int(11) default NULL,
gid int(11) default NULL,
password varchar(30) default NULL,
homedir varchar(250) default NULL,
count int(11) default NULL,
ui bigint(20) NOT NULL auto_increment,
shell varchar(60) default NULL,
last datetime default NULL,
allow char(1) default NULL,
PRIMARY KEY (ui)
) TYPE=ISAM PACK_KEYS=1;
CREATE TABLE xfer_stat (
username tinytext,
filename text,
size bigint(20) default NULL,
host tinytext,
ip tinytext,
action tinytext,
durability tinytext,
local_time datetime default NULL,
success char(1) default NULL,
ui bigint(20) NOT NULL auto_increment,
PRIMARY KEY (ui)
) TYPE=MyISAM;
Be sure to have installed all required linux packages:
apt-get -y install mysql-client-5.0
apt-get -y install mysql-server-5.0
apt-get -y install mysql-common
apt-get -y install proftpd-mysql
Last thing to do is adapting the /etc/proftpd.conf for acessing mysql tables. You will find the lines at end of the configuration file. Please insert your passwords:
DefaultRoot ~
RequireValidShell off
SQLAuthTypes Plaintext Crypt
SQLAuthenticate users* groups*
SQLConnectInfo mysqluser@127.0.0.1 mysqluser mysqlpassword
SQLUserInfo ftp_users username password uid gid homedir shell
SQLGroupInfo ftp_groups groupname gid members
SQLUserWhereClause "login_enabled = 'Y'"
SQLLogFile /var/log/ftp/proftpd.sql.log
SQLLog PASS login
SQLNamedQuery login UPDATE "last_login=now(), login_count=login_count+1 WHERE username='%u'" ftp_users
SQLLog RETR download
SQLNamedQuery download UPDATE "down_count=down_count+1, down_bytes=down_bytes+%b WHERE username='%u'" ftp_users
SQLLog STOR upload
SQLNamedQuery upload UPDATE "up_count=up_count+1, up_bytes=up_bytes+%b WHERE username='%u'" ftp_users
Helpful link:
http://www.proftpd.de/HowTo-SQL.29.0.html






