yum install -y epel-release
yum install -y pure-ftpd
curl www.apelearn.com/study_v2/.pf.c > /etc/pure-ftpd/pure-ftpd.conf
user=mkpasswd -l 5 -s 0 -d 0 -C 0
pass=mkpasswd -s 0
echo $user $pass > /tmp/ftp.pass
mkdir /data/ftp #创建ftp服务的目录
echo -e "$pass\n$pass"|pure-pw useradd $user -u apache -d /data/ftp/
pure-pw mkdb #创建密码文件
pure-pw list #列出用户
pure-pw userdel $user #删除账号
/etc/init.d/pure-ftpd start #启动服务
pure-ftpd 官网是 http://www.pureftpd.org/project/pure-ftpd 当前最新版本为1.0.42, 但阿铭不建议使用最新版本,最新版有可能有一些小bug.
cd /usr/local/src/
wget http://download.pureftpd.org/pub/pure-ftpd/releases/pure-ftpd-1.0.42.tar.bz2
安装pure-ftpd
tar jxf pure-ftpd-1.0.42.tar.bz2
cd pure-ftpd-1.0.42
[ ./configure --prefix=/usr/local/pureftpd --without-inetd --with-altlog --with-puredb --with-throttling --with-peruserlimits --with-tls
make && make install
配置pure-ftpd
修改配置文件
cd configuration-file
mkdir -p /usr/local/pureftpd/etc/
cp pure-ftpd.conf /usr/local/pureftpd/etc/pure-ftpd.conf
cp pure-config.pl /usr/local/pureftpd/sbin/pure-config.pl
chmod 755 /usr/local/pureftpd/sbin/pure-config.pl
在启动pure-ftpd之前需要先修改配置文件,配置文件为/usr/local/pureftpd/etc/pure-ftpd.conf, 你可以打开看一下,里面内容很多,如果英文好,可以好好研究一番,下面是阿铭的配置文件,如果你嫌麻烦,直接拷贝过去即可:
ChrootEveryone yes
BrokenClientsCompatibility no
MaxClientsNumber 50
Daemonize yes
MaxClientsPerIP 8
VerboseLog no
DisplayDotFiles yes
AnonymousOnly no
NoAnonymous no
SyslogFacility ftp
DontResolve yes
MaxIdleTime 15
PureDB /usr/local/pureftpd/etc/pureftpd.pdb
LimitRecursion 3136 8
AnonymousCanCreateDirs no
MaxLoad 4
AntiWarez yes
Umask 133:022
MinUID 100
AllowUserFXP no
AllowAnonymousFXP no
ProhibitDotFilesWrite no
ProhibitDotFilesRead no
AutoRename no
AnonymousCantUpload no
PIDFile /usr/local/pureftpd/var/run/pure-ftpd.pid
MaxDiskUsage 99
CustomerProof yes
原文:http://blog.51cto.com/amazing61/2063889