aptget update //更新数据库
aptget mysqlclient mysqlserver //安装MySQL
aptget proftpdmysql //安装支持MySQL的ProFTPD
mysql uroot p //用Root登录MySQL
create database ftpdb //建ftpdb 数据库
grant select update on ftpdb* to proftpd@% identified by password //新增一个用户用于存取ftpdb 数据库用户名 proftpd密码 password
use ftpdb //对 ftpdb 库操作
#ftpgroup的表结构
CREATE TABLE `ftpgroup` (
`groupname` varchar() NOT NULL default
`gid` smallint() NOT NULL default
`members` varchar() NOT NULL default
KEY `groupname` (`groupname`)
) TYPE=MyISAM;
#插入一条记录
INSERT INTO `ftpgroup` VALUES (ftpgroup ftpuser);
#ftpuser的表结构
CREATE TABLE `ftpuser` (
`id` int() unsigned NOT NULL auto_increment
`userid` varchar() NOT NULL default
`passwd` varchar() NOT NULL default
`uid` smallint() NOT NULL default
`gid` smallint() NOT NULL default
`homedir` varchar() NOT NULL default
`shell` varchar() NOT NULL default /sbin/nologin
`count` int() NOT NULL default
`accessed` datetime NOT NULL default ::
`modified` datetime NOT NULL default ::
PRIMARY KEY (`id`)
) TYPE=MyISAM ;
#插入一条记录
INSERT INTO ftpuser (userid passwd uid gid homedir shell) VALUES
(ftpuser ftppasswd /tony/sbin/nologin); //目录/tony应该存在
修改/etc/nf
加入以下内容
########################################
DefaultRoot ~
SQLAuthTypes Plaintext Crypt
SQLAuthenticate users* groups*
SQLConnectInfo ftpdb@localhost proftpd password
SQLUserInfo ftpuser userid passwd uid gid homedir shell
SQLGroupInfo ftpgroup groupname gid members
SQLMinID
SQLHomedirOnDemand on
SQLLog PASS updatecount
SQLNamedQuery updatecount UPDATE count=count+ accessed=now() WHERE userid=%u ftpuser
SQLLog STORDELE modified
SQLNamedQuery modified UPDATE modified=now() WHERE userid=%u ftpuser
DeferWelcome on
RootLogin off
RequireValidShell off
########################################
/etc/initd/proftpd stop
/etc/initd/proftpd start //使用/etc/initd/proftpd restart 似乎不能达到预期的效果
使用
用户名ftpuser
密码ftppasswd
测试