Pure-FTPd is a free (BSD), secure, production-quality and standard-conformant FTP server.
This guide provides instructions for using the virtual user system to manage and control users. By using virtual users, FTP accounts can be administrated without affecting system accounts.
Let's initiate Pure-FTPd's installation by entering the following commands:
- % su
- # cd /usr/ports/ftp/pure-ftpd
- # make config
- # make install clean
- # rehash
- # cd /usr/local/etc
- # cp pure-ftpd.conf.sample pure-ftpd.conf
- # chmod 644 pure-ftpd.conf
- # vi pure-ftpd.conf
VerboseLog yesThe CreateHomeDir option makes adding virtual users more easy by creating a user's home directory upon login (if it doesn't already exist).
We can either import users with system-level accounts (defined in /etc/master.passwd) at once or create new users manually. To import users that already exist on your system into the virtual user database, enter these commands:
- # pure-pwconvert >> /usr/local/etc/pureftpd.passwd
- # chmod 600 /usr/local/etc/pureftpd.passwd
- # pure-pw mkdb
vftp like this:
- # pw useradd vftp -s /sbin/nologin -w no -d /usr/home/vftp\
- ? -c "Virtual FTP user" -m
- # pure-pw useradd user -u vftp -g vftp -d /usr/home/vftp/user
- # pure-pw mkdb
If you want to add additional users, just repeat the commands above with a different user.
To remove a user:
- # pure-pw userdel user
Now to start Pure-FTPd:
- # /usr/local/etc/rc.d/pure-ftpd onestart
Initiate a FTP connection to test the server:
- % ftp localhost
Trying 127.0.0.1...Now log in with a user account created as explained above. Commands such as ls, cp, pwd and less work just like in tcsh and bash shells. To quit the FTP session type exit.
Connected to localhost.
220---------- Welcome to Pure-FTPd [TLS] ----------
220-You are user number 2 of 50 allowed.
220-Local time is now 13:39. Server port: 21.
220-IPv6 connections are also welcome on this server.
220 You will be disconnected after 15 minutes of inactivity.
To configure Pure-FTPd to start at boot time:
- # echo 'pureftpd_enable="YES"' >> /etc/rc.conf
- # /usr/local/etc/rc.d/pure-ftpd restart
- # /usr/local/etc/rc.d/pure-ftpd status
Pure-FTPd provides useful features for personal users as well as hosting providers. I've only touched the tip of the iceberg so do take a look at the project's website for the excellent documentation that is available.
That's it for now. On a future post I'll explain how to setup Pure-FTPd for anonymous FTP access.