Postfix Virtual Hosting With LDAP Backend And With Dovecot As IMAP/POP3 Server On Ubuntu Trusty Tahr 14.04 - Page 7
This tutorial exists for these OS versions
- Ubuntu 18.04 (Bionic Beaver)
- Ubuntu 14.04 LTS (Trusty Tahr)
- Ubuntu 9.10 (Karmic Koala)
- Ubuntu 8.10 (Intrepid Ibex)
- Ubuntu 8.04 (Hardy Heron)
On this page
Step 8: Install and configure proftpd
First we will install proftpd and its requirements:
aptitude install proftpd proftpd-mod-ldap
Depending on your load you can decide between stand alone and inet.d.
Edit /etc/proftpd/proftpd.conf:
vi /etc/proftpd/proftpd.conf
And change from:
# Use this to jail all users in their homes # DefaultRoot ~
To:
# Use this to jail all users in their homes DefaultRoot
And change:
# Alternative authentication frameworks
#
# Include /etc/proftpd/ldap.conf
#Include /etc/proftpd/sql.conf
To:
# Alternative authentication frameworks
#
Include /etc/proftpd/ldap.conf
#Include /etc/proftpd/sql.conf
~
Now edit /etc/proftpd/modules.conf:
vi /etc/proftpd/modules.conf
And change from:
# Install proftpd-mod-ldap to use this #LoadModule mod_ldap.c
To:
# Install proftpd-mod-ldap to use this LoadModule mod_ldap.c
And from:
# Install proftpd-mod-ldap to use this # LoadModule mod_quotatab_ldap.c
To:
# Install proftpd-mod-ldap to use this LoadModule mod_quotatab_ldap.c
No edit /etc/proftpd/ldap.conf and set the following:
<IfModule mod_ldap.c>
#
#LDAPServer ldap://ldap.example.com
#LDAPBindDN "cn=admin,dc=example,dc=com" "admin_password"
#LDAPUsers dc=users,dc=example,dc=com (uid=%u) (uidNumber=%u)
#LDAPUseTLS on
#
#
#LDAPServer ldaps://ldap.example.com
#LDAPBindDN "cn=admin,dc=example,dc=com" "admin_password"
#LDAPUsers dc=users,dc=example,dc=com (uid=%u) (uidNumber=%u)
#
LDAPServer ldap://127.0.0.1/??sub
LDAPBindDN "cn=phamm,o=hosting,dc=example,dc=tld "readonly"
LDAPUsers "o=hosting,dc=example,dc=tld" "(&(uid=%v)(objectclass=posixAccount))"
LDAPDefaultGID 33
LDAPDefaultUID 33
LDAPForceDefaultGID True
LDAPForceDefaultUID True
</IfModule>
The following commands set the default user to www-data which suits me, you can change these values to suit your setup or leave them out to use the login username.
LDAPDefaultGID 33
LDAPDefaultUID 33
LDAPForceDefaultGID True
LDAPForceDefaultUID True
33 Is the uid/gid of my testing setup, it can be different on your setup.
This concludes the proftpd installation