Proftpd with MySQL + MD5 users’ password on lenny

The old versions of proftpd dont support mysql md5 algorithm for password checks,
so for who have to use debian lenny with proftpd 1.3.1 the only way to make MD5 work is to use PAM-MySQL + libnss-mysql.

With 1.3.x proftpd comes with mod_sql_passwd.c that solve this problem (here a sample conf):

SQLAuthTypes MD5
SQLPasswordEngine on
SQLPasswordEncoding hex
SQLBackend  mysql
SQLEngine on
SQLAuthenticate users
SQLUserInfo custom:/sqlgetuserbyname
SQLNamedQuery sqlgetuserbyname SELECT "username, passwd, 8 as uid , 8 as gid, concat('/var/www/', name), NULL FROM domains WHERE username = '%U'"

To easy install proftpd 1.3.3 on debian lenny without compile it manually and without unistall your existing setup just compile it from debian sources.

Download the proftpd squeeze tar + diff (http://packages.debian.org/squeeze/proftpd-basic).

Edit the debian/control file to match dependencies with your lenny system: remove parenthesis for libssl-dev,debconf,libpam-runtime,debianutils… follow the example:

Depends: netbase (>= 4.13), ${shlibs:Depends}, ${misc:Depends}, debconf (>= 0.5.00), adduser, ucf (>= 0.30), debianutils (>= 1.21.0), libpam-runtime (>= 0.76-13.1),  sed (>= 4.1.5), update-inetd

should be

Depends: netbase, ${shlibs:Depends}, ${misc:Depends}, debconf, adduser,+ ucf , debianutils, libpam-runtime, sed,  update-inetd

Install ‘devscripts’ with ‘aptitude install devscripts’ .

Untar the original package and patch it with the squeeze diff, enter the source dir and type ‘debuild’, after 2 minutes you will see your debian packages in the parent directory, install them with “dpkg -i” and enjoy your new proftpd.

Share

3 Replies to “Proftpd with MySQL + MD5 users’ password on lenny”

Leave a Reply to Nicolo Cancel reply

Your e-mail address will not be published. Required fields are marked *