LDAP authentication with ProFTP in UCS 3.x

From Univention Wiki

Revision as of 08:34, 10 October 2013 by Birkefeld (talk | contribs) (Created page with "__NOTOC__ {{Version|UCS=3.1}} If a FTP server should be used it is usally not wanted to maintain user lists. This article describes how to connect a ProFTP daemon with the doma...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
Produktlogo UCS Version 3.1

If a FTP server should be used it is usally not wanted to maintain user lists. This article describes how to connect a ProFTP daemon with the domain's LDAP. After completing these steps, users can log in to the FTP server with their domain username and password.


Preparation

For the installation to succeed, some packages must be downloaded from the Univention unmaintained repositories. To activate the Univention unmaintained repository, execute the following command:

ucr set repository/online/unmaintained=yes

Hint: Unmaintained packages are not covered by security updates.

Installation

To install the ProFTP daemon on a system, the package univention-ftp must be installed either using the UMC module or by executing the following command in a command line shell:

univention-install univention-ftp

Configuration

The ProFTP daemon must load its LDAP module. Edit the file /etc/proftpd/modules.conf and remove the # in front of the line LoadModule mod_ldap.c

Also edit the file /etc/proftpd/proftpd.conf and remove the # in front of the line Include /etc/proftpd/ldap.conf

Next a simple authentication account should be created using the UDM. This account can then be used for an authenticated bind. To find the DN of the account issue the following command on the command line:

udm users/user list --filter name=<NAME of the account> | grep DN

In the LDAP configuration file /etc/proftpd/ldap.conf use the following settings:

# Only use LDAP Auth
AuthOrder                       mod_ldap.c
<IfModule mod_ldap.c>
LDAPServer <fqdn of the DC master>:7389
LDAPDNInfo "<DN of the authentication account>" "<Password of the authentication account>"
# Get user info (dn, uid, gid)
LDAPDoAuth on "cn=users,$ldap_base"
# GID to name in dir listing
LDAPDoGIDLookups on "cn=groups,$ldap_base"
# UID to name in dir listing
LDAPDoUIDLookups on "cn=users,$ldap_base"
LDAPUseTLS on
# Create homedir if not exists
LDAPGenerateHomedir on
</IfModule> 

Hint: change $ldap_base according to the domain to use. The domain can be obtained by executing ucr get ldap/base in a command line shell.

Further links

Personal tools