I am running vsftpd with Virtual Users (managed through a MySQL db). Each users home/default directory is owned by vsftpd:vsftpd.

I need to give a user read/write permissions to some website files, owned by apache:apache so they can make some changes. I did a bind mount for the web directory to a directory in the ftp user's home/default directory. When logging in, the user is not able to write to the web folder, unless I set files to 777.

Is it possible to set this up with making the directory and it's files 777? The web directory needs to be apache:apache in order for apache to work with it.


It should be possible to work with chmod 777 if the files are static. If the files get created dynamically or you don't want to give everybody access you can use ACLs. For that you need to activate ACLs if not active yet (mount option). Then you could set permissions like this:

setfacl -R -m user:apache:rwx -m default:user:apache:rwx /path/to/website/dir
setfacl -R -m user:ftp:rwx -m default:user:ftp:rwx /path/to/website/dir

These commands set write permissions recursively for the users ftp and apache so that they are inherited for new files.

| improve this answer | |

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.