1

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.

Diamond
  • 9,001
  • 3
  • 24
  • 38
ParoX
  • 302
  • 1
  • 7
  • 21

1 Answers1

7

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>

   # Write Files
   <Limit STOR>
     DenyAll
   </Limit>
</Directory>
HTMHell
  • 173
  • 4
  • 10
pacey
  • 3,833
  • 1
  • 16
  • 31
  • 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 – ParoX Feb 17 '11 at 18:39
  • You have two blocks for Delete Files – Blue Aug 30 '15 at 08:55