How would I prevent writing and deleting to the ~/site/backups/ directory in the ProFTPD config?

So far: I think I have figured out how to disable any kind of deleting:

  <Directory ~/site/backups>
    <Limit DELE>
      DenyAll
    </Limit>
    <Limit RMD>
      DenyAll
    </Limit>
  </Directory>

If there is any better bullet proof way to disable deleting and also some examples on how I can prevent editing/writing as well.

Edit:

Just to note, I can't simply do with permissions because I use the owner and group to calculate quotas in an advanced way. Also, editing and deleting is allowed through the panel, which gets ran as their user. However, I don't want them to be able to do it VIA FTP.

link|improve this question

80% accept rate
feedback

1 Answer

up vote 2 down vote accepted

You could just use a configuration like this:

<Directory ~/site/backups>
   <Limit WRITE>
      DenyAll
   </Limit>
</Directory>

which essentially does the same as this configuration:

<Directory ~/site/backups>
   <!-- Delete Files -->
   <Limit DELE>
     DenyAll
   </Limit>

   <!-- Remove directories-->
   <Limit RMD>
     DenyAll
   </Limit>

   <!-- Make Directory -->
   <Limit MKD>
     DenyAll
   </Limit>

   <!-- Rename From / To -->
   <Limit RNFR>
     DenyAll
   </Limit>
   <Limit RNTO>
     DenyAll
   </Limit>

   <!-- Delete Files -->
   <Limit DELE>
     DenyAll
   </Limit>

   <!-- Write Files -->
   <Limit STOR>
     DenyAll
   </Limit>
</Directory>
link|improve this answer
This is exactly what I wanted, not only did it solve my problem with my backup dir but other directories I wanted everything disabled but STOR. Thanks – BHare Feb 17 '11 at 18:39
feedback

Your Answer

 
or
required, but never shown

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