FreeBSD Server Administration

« Install Awstats on FreeBSD | Main | FreeBSD and Linux »

March 11, 2005

Install ProFTPD

Update: The ProFTPD port seems buggy, I suggest you try pure-ftpd, the installation is very easy and worked very well.

I installed NcFTP client when I just got the server, it seems that "pkg_add -r ncftp" also installed NcFTP server and it worked without any configuration - it gave me an impression that I didn't have to care about the FTP server at all. After some time, my ftp client on Windows started displaying the unregistered version message of NcFTP server. I decided to install a free one - proFTPD.

proFTPD installation is a bit tricky, pkg_add doesn't install the configuration file: /usr/local/etc/proftpd.conf. (Can see the error message when run proftpd in debug mode)

Install proftpd with ports
# cd /usr/ports/ftp/proftpd
# make install

Ports will display a message to insert the following three lines to the PAM configuration /etc/pam.conf (you may have to create it).

ftpd auth required pam_unix.so try_first_pass
ftpd account required pam_unix.so try_first_pass
ftpd session required pam_permit.so

After installation, there are two executable files:
/usr/local/libexec/proftpd
/usr/local/etc/rc.d/proftpd.sh

proftpd.sh didn't work, no error message either.

Run proftpd in debug mode
# /usr/local/libexec/proftpd -n -d 9

It displayed the following error message:

opening scoreboard '/var/run/proftpd/proftpd.scoreboard'
RELINQUISH PRIVS at main.c:2315
error opening scoreboard: No such file or directory

Since the directory /var/run/proftpd doesn't exist, to fix this error, either create the directory manually or add a line in the proftpd config file:
ScoreboardFile /var/run/proftpd.scoreboard

Now I can start proftpd with the following command, although I need to do this every time the server is rebooted.
# /usr/local/libexec/proftpd

Misc
1. I have a few sites on this server, all ftp accounts use /home/username/ as the base ftp directory. To avoid modifying all saved setting on my ftp client software, I uncommented a line in the config file:
DefaultRoot ~

2. There is a few seconds delay when connecting to the server, I had the same problem on my Linux server, later fixed it by removing all entries like the following in the config file:
<VirtualHost>
...
</VirtualHost>

But unfortunately, I can't find similar entries on FreeBSD, please let me know if you know how to fix it.


Category : FTP

Posted by FreeBSD Newbie at March 11, 2005 06:46 PM

Comments

UseReverseDNS off
IdentLookups off

add these to deal with slow authentication or to speed up downloads and uploads.

Posted by Eric Joseph at February 29, 2008 05:02 AM

Post a comment



(Optional, will not be shown to the public)

Remember Me?