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

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.

share|improve this question

2 Answers 2

up vote 2 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 
share|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

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.

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

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.