I have a VSFTPD server based on CentOS 6, configured to authenticate virtual users against an openLDAP server. I can login to the FTP server, however, authenticated users are not redirected to their home directory, but to the VSFTPD's home dir!
Note, that each user's home directory is located to a pseudo-random location, so, I cannot use an attribute like
user_config_dir=$USER
However, in the LDAP the attribute homeDirectory contains the full path of user's home directory. Example:
uid:[email protected]
homeDirectory: /nfs/{RANDOM_storage_location}/{RANDOM_NUMBER}/{DOMAIN}u/s/e/usertest
How can I configure vsftpd to use each user's home directory?
Configuration files:
##Filename: pam_ldap.conf
base dc=example,dc=com
uri ldap://192.168.1.8:389
binddn cn=ftp,ou=read,ou=groups,dc=example,dc=com
bindpw secret
bind_timelimit 300
idle_timelimit 300
timelimit 300
The VSFTPD conf is:
Anonymous_enable=NO
local_enable=YES
write_enable=YES
local_umask=022
dirmessage_enable=YES
# Enable Virtual users
guest_enable=YES
virtual_use_local_privs=YES
chroot_local_user=YES
chroot_list_enable=NO
xferlog_enable=YES
log_ftp_protocol=YES
connect_from_port_20=YES
listen=YES
pam_service_name=vsftpd
userlist_enable=YES
tcp_wrappers=YES
hide_ids=YES
Example connection:
ftp
ftp> o 192.168.1.10
Connected to 192.168.1.10.
220-
220
Name (192.168.1.10:user): [email protected]
331 Please specify the password.
Password:
230 Login successful.
Remote system type is UNIX.
ftp> dir
Using binary mode to transfer files.
229 Entering Extended Passive Mode (|||21725|).
150 Here comes the directory listing.
drwxr-xr-x 2 ftp ftp 4096 Feb 21 09:01 pub
226 Directory send OK.
0 Answers