建立临时pure-ftp服务 回首页

一、安装pure-ftpd
# 在/home/Mary目录中完成安装

yum install -y pam-devel

./configure \
--with-everything \
--with-paranoidmsg \
--sysconfdir=/usr/local/etc \
--with-tls \
--with-language=simplified-chinese \
--with-mysql \
--with-pam \
--with-welcomemsg \
--with-rfc2640 \
--localstatedir=/var

make
sudo make install

二、配置pure-ftpd
1)
sudo cp /home/Mary/pure-ftpd-1.0.31/configuration-file/pure-ftpd.conf /usr/local/etc/pure-ftpd.conf
sudo vi /usr/local/etc/pure-ftpd.conf
修改:
NoAnonymous             yes
PureDB                  /usr/local/etc/pureftpd.pdb

2)
首先, 在系统中添加相应的用户和组, 这里以ftpuser和ftpgroup为例:
/usr/sbin/groupadd ftpgroup
/usr/sbin/useradd -g ftpgroup -d /dev/null -s /etc ftpuser
# 并且创建ftp home目录/home/ftphome/
# (修改ftphome的所有者为ftpuser, 否则没法上传数据)
sudo chown +R ftpuser:ftpgroup ftphome
sudo pure-pw mkdb /usr/local/etc/pureftpd.pdb
sudo pure-pw useradd alice -u ftpuser -d /home/ftphome/alice -m
# (按提示输入密码)
sudo pure-pw passwd alice -m

3)
sudo cp /home/Mary/pure-ftpd-1.0.31/configuration-file/pure-config.pl /usr/local/sbin/pure-config.pl
# (杀死在运行的ftpd)
sudo killall pure-ftpd
# (通过.conf文件启动pure-ftpd.conf)
sudo /usr/local/sbin/pure-config.pl /usr/local/etc/pure-ftpd.conf &

4)修改机器重启时自动运行的脚本:
sudo vi /etc/rc.local
#/usr/local/etc/pureftpd.pdb
sudo /usr/local/sbin/pure-config.pl /usr/local/etc/pure-ftpd.conf &