Posts Tagged ‘pure-ftpd’

The pure-ftpd package that comes with Debian 5.0 (Lenny) does not start in a OpenVZ virtual machine as it is compiled with “capabilities”. This tutorial describes the steps to build a pure-ftpd Debian package with capabilities disabled:

Make a temporary directory

mkdir /usr/src/pure-ftpd
cd /usr/src/pure-ftpd

Download the source package for pure-ftpd

apt-get source pure-ftpd
apt-get build-dep pure-ftpd

Edit the rules file and add the switch “–without-capabilities”

cd pure-ftpd-1.0.21/debian
nano rules

Change the line:

optflags=–with-everything –with-largefile –with-pam –with-privsep –with-tls

to (one Line!):

optflags=–with-everything –with-largefile –with-pam –with-privsep –with-tls –without-capabilities

Build the Debian (.deb) package

cd ..
dpkg-buildpackage -uc -b

and install it

cd ..
dpkg -i pure-ftpd-common_1.0.21-11.4_all.deb pure-ftpd-mysql_1.0.21-11.4_i386.deb
/etc/init.d/pure-ftpd-mysql restart

To prevent that apt overwrites these manually compiled packages with the default packages from the Debian repositorys, execute these commands:

echo 'pure-ftpd-common hold' | dpkg --set-selections
echo 'pure-ftpd-mysql hold' | dpkg --set-selections

This tutorial is based on the german tutorial from planet_fox

If hidden files (files that start with a dot like .htaccess, .bash_history, .profile or .ssh) are not displayed in your FTP client, then they are most likely disabled in the FTP server. To enable hidden files in pure-ftpd on Debian and Ubuntu Linux, execute this command:

echo “yes” > /etc/pure-ftpd/conf/DisplayDotFiles

and then restart pureftpd.

If you run a firewall on your Linux server and want to use passive FTP connections, you have to define the passive port range in pure-ftpd and your firewall to ensure that the connections dont get blocked. The following example is for pure-ftpd on Debian or Ubuntu Linux and ISPConfig 3:

1) Configure pure-ftpd
echo "40110 40210" > /etc/pure-ftpd/conf/PassivePortRange
/etc/init.d/pure-ftpd-mysql restart

2) Configure the firewall. If you use ISPConfig 3 on my server to configure the bastille firewall, you can add the nescessera port range in the ISPConfig firewall settings.

Change the list of Open TCP ports from:




and then click on “Save”.

pure-ftpd does not show more then 2000 files on Debian and Ubuntu

Friday, September 4, 2009 posted by admin

The pure-ftp daemon by default has a recursion limit of 2000 files, this prevents the server from showing more then 2000 files when you browse a directory with a FTP client. To expand this Limit to e.g 5000 files, create or edit the file /etc/pure-ftpd/conf/LimitRecursion and add a line “5000 500″:

echo “5000 500″ > /etc/pure-ftpd/conf/LimitRecursion

and then restart pureftpd:

/etc/init.d/pure-ftpd-mysql restart

If you experience problems with slow logins in pure-ftpd, this is often caused by a problem with the resolving of the clients hsotname. This happens e.g. when you run a FTP server in your intranet and the hostname of the client computer does not exist in DNS. To disable name resolving in pureftpd, run the command:

echo ‘yes’ > /etc/pure-ftpd/conf/DontResolve

and then restart pure-ftpd

/etc/init.d/pure-ftpd-mysql restart

Disabling name resolving also fixes the following error message:

Jul 24 16:26:28 ispconfig pure-ftpd: (?@?) [ERROR] Sorry, invalid address given

How to enable verbose logging in pure-ftpd on Debian Linux

Friday, July 24, 2009 posted by admin

To turn on verbose logging (e.g. to debug FTP connection or authentication problems) inĀ  pure-ftpd FTP server on Debian and Ubuntu Linux, execute the following command as root user in the shell:

echo 'yes' > /etc/pure-ftpd/conf/VerboseLog

and then restart pure-ftpd

/etc/init.d/pure-ftpd-mysql restart

The debug output will be logged to syslog. To view the log content, execute:

tail -n 100 /var/log/syslog

To disable verbose logging, execute these commands:

rm -f /etc/pure-ftpd/conf/VerboseLog
/etc/init.d/pure-ftpd-mysql restart