Posted by: jasonk2600 | December 30, 2009

FreeBSD Public Anonymous FTP Server


This document describes the basic steps necessary to configure a FreeBSD system to perform the role of a public anonymous-only FTP server.  The PureFTPd FTP server software will be used to service FTP requests.


Configure and install the PureFTPd FTP server from the FreeBSD ports collection.  NOTE: The default port configuration is acceptable.

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



Before the PureFTPd FTP server can be used, a user must be created for the FTP service to run under. Create a new user named ftp.

# adduser
Username: ftp
Full name: FTP User
Uid (Leave empty for default):
Login group [ftp]:
Login group is ftp. Invite ftp into other groups? []:
Login class [default]:
Shell (sh csh tcsh nologin) [sh]: nologin
Home directory [/home/ftp]:
Home directory permissions (Leave empty for default):
Use password-based authentication? [yes]:
Use an empty password? (yes/no) [no]:
Use a random password? (yes/no) [no]:
Enter password:
Enter password again:
Lock out the account after creation? [no]:
Username   : ftp
Password   : ***********
Full Name  : FTP User
Uid        : 1002
Class      :
Groups     : ftp
Home       : /home/ftp
Home Mode  :
Shell      : /usr/sbin/nologin
Locked     : no
OK? (yes/no): yes
adduser: INFO: Successfully added (ftp) to the user database.
Add another user? (yes/no): no


The sample configuration file is a good starting point.

# cd /usr/local/etc
# cp pure-ftpd.conf.sample pure-ftpd.conf


Modify the PureFTPd configuration file, /usr/local/etc/pure-ftpd.conf, and set the following items.

DisplayDotFiles    no
AnonymousOnly    yes
ProhibitDotFilesWrite    yes
ProhibitDotFilesRead    yes
AnonymousCantUpload    yes
TLS    0


Enable PureFTPd in /etc/rc.conf and start it for the first time.

# echo 'pureftpd_enable="YES"' >> /etc/rc.conf
# /usr/local/etc/rc.d/pure-ftpd start
Starting pureftpd.



Start your favorite FTP client and open a connection to the newly configured FTP server and login anonymously. If the client fails to connect or login, check the system log file, /var/log/messages, for any error messages.



Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


%d bloggers like this: