mod_ldap
is a third-party module that allows proftpd to do user
authentication and name/UID lookups against an LDAP database.
Please note: Read the CHANGES section below for
mod_ldap v2.7
changes; some significant changes have been made.
Do NOT upgrade to mod_ldap v2.7 before reading the CHANGES section.
Sections:
1. How do I set up mod_ldap?
If you are using a version of mod_ldap
included with a
ProFTPD release, you can simply:
tar xvzf proftpd-version.tar.gz cd proftpd-version ./configure --with-modules=mod_ldap make make installAdd the contents of
posixAccount-objectclass
to your
slapd.oc.conf
(or equivalent) and restart your LDAP server. If
you plan on using mod_ldap
for group lookups, also add the
contents of posixGroup-objectclass
. The user-ldif
file contains a sample user ldif. Modify it to your liking and say:
ldapadd -D your-root-dn -w your-root-dn-password < ldif
Read up on the LDAP configuration directives. At a bare minimum, you'll need
to have the
LDAPServer
,
LDAPDNInfo
,
and LDAPDoAuth
configuration directives in your proftpd.conf
.
A sample set of LDAP configuration directives is included here:
LDAPServer localhost LDAPDNInfo cn=your-dn,dc=horde,dc=net dnpass LDAPDoAuth on "dc=users,dc=horde,dc=net"
If you wish to use a newer version of mod_ldap that is not yet included with
a release version of ProFTPD, simply download the file
mod_ldap.c
, say:
cp -f mod_ldap.c proftpd-version/contriband then follow the same steps as above.
2. Changes in v2.5.2 - v2.7.1
Please check the web site for previous changelogs.
v2.7.1:
AuthBind
s with those LDAP servers would break in previous
mod_ldap
versions. See the comments in the code for more
details (search for "Sun Directory Services").objectclass
attribute for each of your LDAP objects. This
attribute must have a value of posixAccount
("objectclass: posixAccount"). For groups, this attribute must have the
value posixGroup
("objectclass: posixGroup"). If you wish to
disable this objectclass enforcement, use the the LDAP filter
"(uid=%u)"for Auth and UID lookups (see
doc/Configuration.html
for how to specify a custom
LDAP search filter).
For example, to replicate basic allowedServices
checking,
pass this LDAP search filter to LDAPDoAuth
:
(&(uid=%u)(|(allowedServices=*FTP*)(!(allowedService=*))))
To emulate deniedServices
checking, use this search filter:
(&(uid=%u)(!(deniedServices=*FTP*)))
To emulate both allowedServices
and
deniedServices
checking, use this filter:
(&(uid=%u)(|(allowedServices=*FTP*)(!(allowedService=*)))(!(deniedServices=*FTP*)))
HomedirOnDemandSuffix
- create an additional subdirectory
in a user's home directory (/home/user/anotherdirectory
) on
demand.mod_ldap.c
and uncomment #define HAVE_OPENSSL
.
You'll also need to edit Make.rules
to link against
OpenSSL. Further details are provided in mod_ldap.c
.proftpd.conf
.
mod_ldap
to log varying debug info
perror()
-like error reporting to improve error messages
shadowAccount
objectclass stuff - inactive, expiration, etc.
mod_ldap
up and
running at your site, or even have some code improvements or ideas for
development, please let me know!