0

I am trying to setup a FTP server. I am using VsFTPd on an Ubuntu server that will authenticate against an LDAP server. My users should have access to their personal directory (read/write), to their public directory (read/write), to the public directory of other users (read) and to a general public directory (read). Admin users have read/write access on all directories.

My problem is the following: when a user is created on the LDAP server, he should be able to connect to the FTP server. But his directories will not be created on the FTP server. Another part of the problem is the modification of the status of an user: if an user becomes admin, how do I change his configuration to give him access to all the directories?

One solution would be to execute a script when an user tries to connect to the FTP server. This script would check if the directories are created and if not, create them. But how can I configure VsFTPd to execute a script when an user logs in?

Thank you for your help.

Alfred Huang
  • 17,654
  • 32
  • 118
  • 189
Totor
  • 31
  • 1
  • 8

1 Answers1

0

You should use the pam module pam_mkhomedir. Use it globally for all the system or only for VsFTP if your installation was compiled against libpam.so. Check this using ldd in the vsftpd binary.

cps0
  • 1
  • Well... I am not there yet. I can't even get vsftpd to connect to the LDAP server through PAM. I get a "vsftpd: pam_ldap: ldap_simple_bind Can't contact LDAP server". – Totor Oct 04 '11 at 21:51
  • It is because the nss_ldap library was not correctly setup. Check the files for or distribution. Most of the time /etc/ldap.conf, /etc/libnss_ldap.conf or /etc/libpam_ldap.conf. – cps0 Oct 13 '11 at 02:23
  • Just for the records... I could not get vsftpd and pam_mkhomedir to auto-create directories on a vanilla Debian 6.0 Squeeze and pam_mysql, and yes, I have `session_support=YES` in my `/etc/vsftpd.conf`. Seems there is something other missing. – Arc Jan 26 '12 at 09:04