CentOS / Redhat: Give file permission for apache and vsftp

centosftppermissionsredhatvsftpd

I use CentOS 5.5 and Apache Webserver on my dedicated Server. My Folder "/var/www/myWebApp" is owned by apache, so that apache can read, write logs, etc..

But now I would like to use very secure FTP (vsftp) to upload my new files. I used to give every user rwx -Acess to "/var/www/myWebApp", but I guess this is way to insecure.

On CentOS I created another user "ftpuser" for uploading files and that has "/var/www/myWebApp" as its home directory. How can I give him the permission to write into the "/var/www/myWebApp" without giving every user the same rights?

Best Answer

CentOS 5.5 should have filesystem ACLs on by default, just use setfacl to give 'ftpuser' the rights:

setfacl -R -m u:ftpuser:rwx /var/www/myWebApp

See the man page for setfacl/getfacl if you've never used them before.