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.

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.

share|improve this question
add comment

1 Answer 1

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>
share|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
add comment

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.