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?

  • 3
    Please be aware that although the name is "very secure", vsftp is only more secure relative to other ftp daemons. It still is not a secure protocol. I highly recommend using sftp instead, which has the advantage of it probably is already working because the server side is part of sshd.
    – mattdm
    Dec 3 '10 at 17:24
  • +1. FTP is inherently insecure, regardless of the name :) Dec 3 '10 at 17:25

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.

  • in addition to this acl you can also set the SUID and GUID bits to make sure the files are owned by the same user and or group. Feb 17 '16 at 10:01

You could put 'ftpuser' into the apache group, so group level permissions would apply instead of 'everyone'.

usermod -G ftpuser,apache ftpuser

This will change the users groups to both ftpuser and apache.


Combine two user in one group, and adjust directory rights to this group. Or, simply run vsftpd under 'apache' user.

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.