1

I run vsftpd: version 3.0.2 on Debian 8. I have a folder /home/vsftpd/$USER which is mounted on an NFS.

$USER is replaced by the user name connected on the FTP. Those users are authenticated against MySQL using pam-mysql.

All the users can connect to the FTP BUT none of them are able to see their files and folders. I've tried 777 on their $USER folder and sub-folders but nothing.

I managed to have a file displayed but I don't know how/why. But I was unable to download the file:

Status: Starting download of /a
Command:    CWD /
Response:   250 Directory successfully changed.
Command:    TYPE A
Response:   200 Switching to ASCII mode.
Command:    PASV
Response:   227 Entering Passive Mode (**.**.**.**,24,163).
Command:    RETR a
Response:   550 Failed to open file.
Error:  Critical file transfer error

I have two issues: users connected to the FTP cannot see their files and folders and I'm unable to dowload a file.

Here is the vsftpd.conf

listen=YES

anonymous_enable=NO
local_enable=YES

write_enable=NO
anon_upload_enable=NO
anon_mkdir_write_enable=NO
anon_other_write_enable=NO

guest_enable=YES
guest_username=vsftpd

chroot_local_user=YES

max_clients=200
max_per_ip=4

pasv_enable=YES
pasv_min_port=6000
pasv_max_port=6800
pasv_address=**.**.**.**

secure_chroot_dir=/var/run/vsftpd
pam_service_name=vsftpd

rsa_cert_file=/etc/vsftpd/***.com.pem
rsa_private_key_file=/etc/vsftpd/**.com.key
#user_config_dir=/etc/vsftpd/vsftpd_user_conf

local_root=/home/vsftpd/$USER
user_sub_token=$USER

Logs for the file download error /var/log/vsftpd.log

FTP response: Client "91.177.204.148", "230 Login successful."
Sun Dec 10 13:52:59 2017 [pid 14999] [*] FTP command: Client "***", "CWD /"
Sun Dec 10 13:52:59 2017 [pid 14999] [*] FTP response: Client "***", "250 Directory successfully changed."
Sun Dec 10 13:52:59 2017 [pid 14999] [*] FTP command: Client "***", "TYPE A"
Sun Dec 10 13:52:59 2017 [pid 14999] [*] FTP response: Client "***", "200 Switching to ASCII mode."
Sun Dec 10 13:52:59 2017 [pid 14999] [*] FTP command: Client "***", "PASV"
Sun Dec 10 13:52:59 2017 [pid 14999] [*] FTP response: Client "***", "227 Entering Passive Mode (52,58,132,46,23,207)."
Sun Dec 10 13:52:59 2017 [pid 14999] [*] FTP command: Client "***", "RETR a"
Sun Dec 10 13:52:59 2017 [pid 14999] [*] FTP response: Client "***", "550 Failed to open file."
Sun Dec 10 13:52:59 2017 [pid 14999] [*] FAIL DOWNLOAD: Client "***", "/a", 0.00Kbyte/sec

EDIT

I've added local_umask=022 (don't know if it is useful or not)

1
  • Look in your server log files they will likely have additional information on the 500 error. – user9517 Dec 9 '17 at 22:00
0

I solved those two issues by setting the permissions to 0555 to folders and files (files should only have 0444).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.