FreeBSD 7.0-RELEASE-i386

# cd /usr/ports/ftp/pure-ftpd && make install clean

如果用户多可以用MYSQL或者PGSQL管理。

# mkdir /home/ftp
# pw useradd ftp -g ftp -G www -c “PureFTPd user Management” -d /home/ftp -s /sbin/nologin
# pw usermod -n www -G ftp
# chown ftp:ftp /home/ftp
# cp /usr/local/etc/pure-ftpd.conf.sample /usr/local/etc/pure-ftpd.conf
# chmod 664 /usr/local/etc/pure-ftpd.conf
# ee /usr/local/etc/pure-ftpd.conf

77行:NoAnonymous yes
126行:PureDB /usr/local/etc/pureftpd.pdb
240行:MinUID 1000
311行:AltLog stats:/var/log/pureftpd.log

如果ftpname为wheel组,是不可以成为FTP用户的,要该为其他组
# pw usermod -n ftpname -g ftp
# pw usermod -n ftpname -G wheel

# /usr/local/bin/pure-pw useradd ftpu -u ftpname -d /home/ftpname/public

ftpu是FTP用户名,-u ftpname是实际FreeBSD用户,-d锁定起始目录,-D不锁定。如果需要不同权限,建立新的FreeBSD用户、组与之对应。

# /usr/local/bin/pure-pw mkdb /usr/local/etc/pureftpd.pdb
# pw usermod -n ftpname -g wheel

$ mkdir /home/ftpname/public
$ ln -s /usr/local/www/apache22/data /home/ftpname/public/www

# echo ‘pureftpd_enable=”YES”‘ >> /etc/rc.conf
# chown -R ftpname:wheel /usr/local/www/apache22/data

# /usr/local/etc/rc.d/pure-ftpd start

修改用户目录:
# /usr/local/bin/pure-pw usermod ftpu -d /home/ftpname/public

# /usr/local/bin/pure-pw mkdb /usr/local/etc/pureftpd.pdb
# /usr/local/etc/rc.d/pure-ftpd restart

修改用户密码
# /usr/local/bin/pure-pw passwd username -m

2 Comments

Leave a Reply