I am authenticating a ProFTPD (with mod_sftp
) instance with a LDAP server. I want to have the following setup:
A chroot for all users to /home/ftp
. (This works).
Now I would like to chroot specific LDAP groups to a different folder under /home/ftp
. For example, users who are in the LDAP group "external" should only see /home/ftp/external
and users not in that group should see /home/ftp
.
All the uploaded files should belong to the same Linux user.
My ldap.conf
is
<IfModule mod_ldap.c>
LDAPServer ldap://localhost:389/??sub
LDAPDefaultUID 2004
LDAPDefaultGID 2004
LDAPForceDefaultGID on
LDAPForceDefaultUID on
LDAPGenerateHomedir on
LDAPGenerateHomedirPrefix /home/ftp
LDAPGenerateHomedirPrefixNoUsername on
CreateHome off
LDAPBindDN "cn=admin,dc=example,dc=com" password
LDAPUsers ou=Users,DC=example,DC=com (uid=%u)
</IfModule>
and in my proftpd.conf
I use:
DefaultRoot /home/ftp
I actually don't have a clue how to proceed here or how to structure it... I may be able to slightly change the setup, and maybe create a small amount of Linux users or a Linux group, but I am rather not able to change the LDAP server (it is a Active Directory to which I don't have access), so preferably everything should be configurable in ProFTPD.
A bonus would be if the directory structure could be setup in the AD, though (maybe with home directory?), so that I don't have to change the ProFTPD configuration for every "special" group.
Any advise would be deeply appreciated :)
Thanks!