I am installing a proftpd server on a debian dedicated server,In order to be able to update some website files in this folder :/var/www/websiteI have added a new user : my-ftp-userThis user's root is /var/www/website, but the owner HAS TO be apache2 (www-data).So I changed the user's groups :usermod -a -G ftpuser my-ftp-userusermod -a -G www-data my-ftp-userThe permissions of folder /var/www/website are currently 755.The subfolders are also in 755 mode, but the subfiles are in 644 mode.If I am right, my-ftp-user should now be able to add, edit, remove files in /var/www/website, am I not ?$ su my-ftp-user$ cd /var/www/website$ ls -ladrwxr-xr-x  5 www-data www-data  4096 juil. 30 13:47 .drwxr-xr-x 22 root   www-data  4096 juil. 30 13:36 ..-rw-r--r--  1 www-data www-data   418 juil. 28 18:39 index.php$ cat index.php // WORKS$ touch test.txt // DOESN'T WORK : permission denied, why ?
Debian file's permissions for secondary's group of user
permissions;filesystems;users;not root user
The reason for EPERM (the permission denied error ) is here:drwxr-xr-x  5 www-data www-data  4096 juil. 30 13:47 .The directory where you are trying to create a file (in other words change contents of the directory-file) is writeable only for user www-data, which you are not.Either mark the directory as writeable for the group, change the user to www-data (or change the owner to my-ftp-user) or (probably the best solution) use extended ACLs with the setfacl command.