First, a brief description of Pure-FTPd, from the official documentation:
Pure-FTPd is a fast, production-quality, standard-conformant FTP server, based upon Troll-FTPd.
Features include chroot()ed and/or virtual chroot()ed home directories, virtual domains, built-in 'ls', anti warez system, configurable ports for passive downloads, FXP protocol, bandwidth throttling, ratios,
LDAP / MySQL / PostgreSQL-based authentication, fortune files, Apache-like log files, fast standalone mode, text / HTML / XML real-time status report, virtual users, virtual quotas, privilege separation, SSL/TLS and more.
Something to keep in mind is that, unlike other FTP servers, Pure-FTPd is controlled through command line arguments, rather than a configuration file. The latter is possible, but I won't cover it here.
Before going into the commands, I want to explain the concept of virtual users. These are FTP-only accounts that don't have to exit on the system, since they're used only for FTP. They have to be associated with a system user, so a good practice which I'll follow here is to create a dedicated system account just for FTP. Thousands of virtual users can share the same system user, as long as they all are chrooted and they have their own home directory.
Now, on to getting the server ready to..serve. First, create a group for FTP activities:
- groupadd ftpgroup
- useradd -g ftpgroup -d /dev/null -s /etc ftpuser
Next, make a directory for FTP users:
- mkdir /home/ftpusers
- mkdir /home/ftpusers/testuser
- pure-pw useradd testuser -u ftpuser -d /home/ftpusers/testuser
Next step is to commit all the virtual users changes to a PureDB file. Without committing changes to the database, the accounts won't be activated, and unusable.
- pure-pw mkdb
- ln -s /etc/pure-ftpd/pureftpd.passwd /etc/pureftpd.passwd
- ln -s /etc/pure-ftpd/pureftpd.pdb /etc/pureftpd.pdb
- ln -s /etc/pure-ftpd/conf/PureDB /etc/pure-ftpd/auth/PureDB
- echo no > /etc/pure-ftpd/conf/UnixAuthentication
- echo no > /etc/pure-ftpd/conf/PAMAuthentication
- chown -R ftpuser /home/ftpusers
- chgrp -R ftpgroup /home/ftpusers
No comments:
Post a Comment