One of our dev boxes runs debian and VSFTPD, I would like to allow a few select users to write to /var/www/testsite and it's sub dirs.

They can browse to /var/www via a symlink in their home dirs, but they can't write. It doesn't matter if it's using FTP or SFTP.

Any ideas? I find this problem difficult to google.

link|improve this question
feedback

2 Answers

up vote 1 down vote accepted

What are your permissions on /var/www/ and /var/www/testsite/ ?

My suggestion is to give /var/www/testsite/ a group such as testsiteGroup, make sure /var/www/testsite has rw permissions for group and then add the users to group testsiteGroup.

chgrp -R testsiteGroup /var/www/testsite/ 
chmod g+w /var/www/testsite/ 
usermod -a -G testsiteGroup # this wil be done for each user, and the -a is critical 
                            # the -a appends group to users groups, without -a you will
                            # be replacing the users groups with the one listed 
link|improve this answer
Thanks, I have had some success with fiddling – Mathnode Oct 11 '10 at 13:00
No problem glad it worked. – Chris Oct 11 '10 at 13:10
feedback

If you use full authentication through SFTP (you should, for accounting) then vsftpd will use user's permissions to modify files.

Because of this there are two solutions:

  • add users to group under which the web server is running (usually www-data or www)
  • use ACLs and add default ACLs to directories in /var/www, this is much more fine-grained, but the partition needs to be mounted with acl flag

If you use anonymous access or FTP (which is by nature insecure), I'd strongly suggest going the second route.

link|improve this answer
thanks, that also did the trick :D – Mathnode Oct 11 '10 at 13:01
feedback

Your Answer

 
or
required, but never shown

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