Linux(以CentOS为例)下编译安装pureftpd(虚拟用户)
Linux下ftp服务器使用者貌似以pureftpd居多,于是我就尝试在centos下编译安装pureftpd,几番折腾后终于成功了...
直接上代码吧
wget http://download.pureftpd.org/pub/pure-ftpd/releases/pure-ftpd-1.0.42.tar.gz --no-check-certificate tar zxvf pure-ftpd-1.0.42.tar.gz cd pure-ftpd-1.0.42./configure --prefix=/usr/local/pureftpd CFLAGS=-O2 --with-puredb --with-quotas --with-cookie --with-virtualhosts --with-diraliases --with-sysquotas --with-ratios --with-altlog --with-paranoidmsg --with-shadow --with-welcomemsg --with-throttling --with-uploadscript --with-language=english --with-rfc2640 --with-ftpwho
make && make install
mkdir /usr/local/pureftpd/etc
cp configuration-file/pure-ftpd.conf /usr/local/pureftpd/etc/
cp configuration-file/pure-config.pl /usr/local/pureftpd/sbin/
chmod 755 /usr/local/pureftpd/sbin/pure-config.pl
修改配置文件/usr/local/pureftpd/etc/pure-ftpd.conf
#取消注释并修改为如下 (看清楚,需要修改配置文件中puredb的路径)
PureDB /usr/local/pureftpd/etc/pureftpd.pdb
启动pureftpd
/usr/local/pureftpd/sbin/pure-config.pl /usr/local/pureftpd/etc/pure-ftpd.conf --daemonize
关闭pureftpd
kill `cat /var/run/pure-ftpd.pid`
添加ftp用户组和用户
groupadd ftpgroup useradd ftpuser -g ftpgroup -d /home/ftp -s /sbin/nologin添加ftp用户
/usr/local/pureftpd/bin/pure-pw useradd username -u ftp -d /home/wwwroot/default
写入数据库
/usr/local/pureftpd/bin/pure-pw mkdbpureftpd用户常用操作
pure-pw useradd <login> [-f <passwd file>] -u <uid> [-g <gid>] -D/-d <home directory> [-c <gecos>] [-t <download bandwidth>] [-T <upload bandwidth>] [-n <max number of files>] [-N <max Mbytes>] [-q <upload ratio>] [-Q <download ratio>] [-r <allow client host>[/<mask>][,<allow client host>[/<mask>]]...] [-R <deny client host>[/<mask>][,<deny client host>[/<mask>]]...] [-i <allow local host>[/<mask>][,<allow client host>[/<mask>]]...] [-I <deny local host>[/<mask>][,<deny local host>[/<mask>]]...] [-y <max number of concurrent sessions>] [-z <hhmm>-<hhmm>] [-m]备注:
pureftpd每次添加用户后需要写入数据库,重启pureftpd后生效
如果配置都正确,出现530错误,请参考
把pure-ftpd.conf 中的 MinUID 值改为2(原来为100,改小一些,不是非2不可,MinUID为FTP用户UID的最小值,本次添加的FTP用户UID小于100,不符合此条件,故登录530。
需要给FTP目录增加读写权限和文件夹用户修改为ftp用户
chmod -R 755 dir_path chown -R ftp:ftp dir_path
原来博主也喜欢pureftpd
洒家也是人云亦云,大家说好,才去学习使用