1.安装pureftpd
sudo apt-get install pure-ftpd
sudo apt-get install pure-ftpd-mysql
2.创建数据库和存放ftp用户表
CREATE TABLE `users` (
`User` VARCHAR(16) NOT NULL DEFAULT '',
`Password` VARCHAR(64) NOT NULL DEFAULT '',
`Uid` VARCHAR(11) NOT NULL DEFAULT '-1',
`Gid` VARCHAR(11) NOT NULL DEFAULT '-1',
`Dir` VARCHAR(128) NOT NULL DEFAULT '',
`comment` tinytext NOT NULL,
PRIMARY KEY (`User`),
UNIQUE KEY `User` (`User`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='FTP用户'
3.配置
编辑/etc/pure-ftpd/db/mysql.conf
#MYSQLServer localhost
#MYSQLPort 3306
MYSQLUser pureftpd
MYSQLPassword ftpdpass
MYSQLDatabase pureftpd
#MYSQLCrypt md5, cleartext, crypt() or password() – md5 is VERY RECOMMENDABLE uppon cleartext
MYSQLCrypt md5
4.一些配置
//限制用户在自己家目录
echo “yes” >/etc/pure-ftpd/conf/ChrootEveryone
echo “no” >/etc/pure-ftpd/conf/AnonymousOnly