By admin,
Saturday, November 24 2007.
Permalink
计算机
1. 安装带MySQL支持的proftpd:
USE="mysql" emerge proftpd
2. 建立数据库:
create database ftp;
grant all privileges on ftp.* to ftp@localhost identified by "ftp000";
create table `users` ( usrname varchar(255) not null, passwd varchar(255) not null, uid int unsigned default null, gid int unsigned default null, home varchar(255) not null, shell varchar(255) not null, primary key(`usrname`) )type=myisam;
create table `groups` ( grpname varchar(255) not null default '', gid int unsigned not null default '0', members text not null, primary key(`grpname`) )type=myisam;
insert into users values('druggo',password('1234'),10001,10000,'/home/druggo/','');
insert into groups values('gentoo','10000','druggo');
3. 加入验证信息到配置文件/etc/proftpd/proftpd.conf
SQLAuthTypes Backend Crypt
SQLAuthenticate users* groups*
SQLConnectInfo ftp@localhost ftp ftp000
SQLUserInfo users usrname passwd uid gid home shell
SQLGroupInfo groups grpname gid members
4. 启动MySQL和Proftpd,测试登录,OK。
5. 需要限制用户在自己的home里,加一句
DefaultRoot ~
6. 支持上传续传,(下载续传默认支持)
AllowStoreRestart on
4 reactions
1 From druggo - 24/11/2007, 17:05
<Directory />
AllowOverwrite on
AllowStoreRestart on
AllowRetrieveRestart on
</Directory>
上传下载都端点续传
2 From druggo - 24/11/2007, 17:28
http://www.castaglia.org/proftpd/
非常全的非官方文档
3 From puNk!d - 24/11/2007, 18:16
就是不喜欢启动MySQL,所以选择vsFtpd而不是proftpd
4 From druggo - 24/11/2007, 20:20
此言差矣,proftpd同样可以不用数据库,用文件来支持虚拟用户/组。