3
2
I'm developing a website in Netbeans where I configured FTP to upload files to my server. On the server - Ubuntu 14.04 LTS - I created a user called "ftpuser" specifically for this task. I installed vsFTPd to handle file uploads. Its config is blow:
listen=YES
anonymous_enable=NO
local_enable=YES
write_enable=YES
file_open_mode=0644
local_umask=022
dirmessage_enable
use_localtime=YES
xferlog_enable=YES
connect_from_port_20=YES
allow_writeable_chroot=YES
chroot_local_user=YES
secure_chroot_dir=/var/run/vsftpd/empty
pam_service_name=vsftpd
rsa_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
rsa_private_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
The starting directory of ftpuser is /var/www:
ftpuser:x:1005:1007:ftp user,,,:/var/www:/bin/bash
Everytime I try to upload a file, Netbeans says "Error, file NOT sent: file.php" and packet inspection with wireshark returns me these errors:
226 - Transfer done (but failed to open directory)
553 - Could not create file.
Even with just doing ftp with the PUT operation gives me Error 553. The FTP user has no trouble logging in and changing directory.
The directory and all its subdirectories and files have the permissions set to 755 (777 - local_umask).
Is there something I'm missing? It used to work perfectly and I can't remember changing anything in Netbeans or vsFTPd.
UPDATES
The owner of the directory (and subdirectories / files) is set to:
drwxr-xr-x 6 marijn marijn 4096 Sep 1 14:21 noc
Even chowning this to ftpuser:ftpuser does not do anything.
You give the permissions but not the owner/group of the directories. Can you please provide this ? – Pierre-Alain TORET – 2015-10-27T10:57:11.160
This is what the log says: [ftpuser] FAIL UPLOAD: Client "x.x.x.x", "/noc/app/controllers/noc/app/controllers/dashboard.php", 0.00Kbyte/sec. The directory to where it's supposed to be uploaded is noc/app/controllers. – Beeelze – 2015-10-27T11:02:32.453