Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

share|improve this question
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 :) –  Rafiq Maniar Dec 3 '10 at 17:25

3 Answers 3

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.

share|improve this answer

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.

share|improve this answer

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

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.