1

I have two users: www-data with a group www-data ftp_user used for VSFTPD to connect to the server with group www-data

There is a folder owned by ftp_user:www-data for the FTP - ftp_folder with permissions: drwxrwxrwx 4 ftp_user www-data 4096

In that folder, I'm using simple PHP script to create a dir:

mkdir('test', 0777, true);
  • PHP runs www-data. The created by PHP folder (ftp_folder/test) is owned by www-data:www-data, with permissions: drwxr-xr-x 2 www-data www-data 4096

If I try to upload a file in it (test folder) via FileZilla (ftp_user), I am getting

553 Could not create file.

VSFTPD config:

chroot_local_user=YES
allow_writeable_chroot=YES
force_dot_files=YES


file_open_mode=0777
local_umask=033

anon_mkdir_write_enable=YES
anonymous_enable=NO
local_enable=YES
write_enable=YES

How to make in that ftp folder all users or both (ftp and www-data) to have full access and when one user create folder/file other user to be with full access for the same ?

1 Answer 1

0

I also have this problem. Whenever I create folders/files via www-data (PHP). Those files/folders can't be deleted via my system user via vsftp.

I constantly need to run the command on my ubuntu-server: sudo chown -R root:mySystemUser MyWebsiteFolder

after that I can delete the file/folder via vsftp.

HELP, I don't want to need to run this command constantly for new files

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .