Based on file size and number of files per upload, I wish to restrict
my FTP users (via Proftpd configuration directives) to save hard disk
space.
1. MaxStoreFileSize - is this the most appropriate directive to
restrict size of upload files (e.g. 10 MB max limit)?
2. Some users don't have large files but upload thousands of small
files. What directive would restrict the number of files per upload?
If no directive is relevant then please suggest other solutions.
3. Do you foresee any serious consequences with the two restrictions
above?
Thank you. |
Request for Question Clarification by
maniac-ga
on
18 May 2003 12:00 PDT
Hello Whizhost,
I have done some research related to your questions and have some
preliminary answers. If these are acceptable, I'll add some material
(references and hints) and post these as an answer - if not, I can
work further on these questions. See the end for a few issues that may
affect how you set this up.
#1 MaxStoreFileSize - certainly this is to be used to limit the
maximum file size. Limiting the maximum file size would help control
disk space but can also help by indirectly setting a limit on
connection duration. Depending on your users however, this setting may
cause problems if the limit is "too low" - expect what "too low" to
increase over time.
#2 Limiting files per upload / total number of files - there does not
appear to be a direct way to limit the number of files uploaded. There
are a number of rate limits (e.g., simultaneous connections per user,
bandwidth per connection) but if the user was patient enough - all the
files would be uploaded. If you applied one or more of these, they
would apply for all users of that virtual host. I can provide links to
suggestions related to multiple virtual hosts to make the limits more
fine grained.
#3 Are there serious consequences? I guess it depends on what the
limit are set to and your definition of "serious". Some limits have a
caution indicating that a setting of 1 would prevent all connections -
I would categorize that as "serious", but something easy to avoid.
An alternative to #1 and #2 - described as "not compiled by default"
is mod_quotatab.
http://www.castaglia.org/proftpd/modules/mod_quotatab.html
It appears to be actively maintained - the latest version released in
March 2003. I could not find a pre built version of this - if you want
to pursue this - I should be able to provide some instructions on how
to build proftp and this specific module. In that case, I suggest
indicating the system you are running proftpd on (e.g., Red Hat Linux
7.3) so the instructions can be more specific.
--Maniac
|
Clarification of Question by
whizhost-ga
on
18 May 2003 16:47 PDT
Maniac,
Your preliminary answer for question #2 does not address the issue.
From my experience, restricting rate limits doesn't work (when trying
to save disk space) because users who want to upload a large file will
upload it in any case and it doesn't matter how long it will take - 1
second or 10 minutes.
If you can provide more information that can specifically address
question #2 then I will accept your answer. Thank you.
|
Clarification of Question by
whizhost-ga
on
18 May 2003 17:04 PDT
Addendum to my earlier clarification - ...restricting rate limits
doesn't work (when trying to save disk space) because users who want
to upload thousands of small files will upload it in any case. The
suggested restriction doesn't need to be a hard limit but it should
*significantly* limit users who use my server as a backup device/photo
album.
|
Request for Question Clarification by
maniac-ga
on
19 May 2003 04:58 PDT
Hello Whizhost,
As I mentioned for #2 - there is no direct way to do what you want in
the default build of proftpd. I described the rate limits since they
do provide a way to discourage (but not prevent) the large uploads.
[it is the closest to what you asked for without pursuing an
alternative]
I also followed up with another solution:
- build your own copy of proftpd and include mod_quotatab which adds
a comprehensive file quota implementation to proftpd.
This appears to do what you ask for and has some supporting tools. I
suggest you review
http://www.castaglia.org/proftpd/modules/mod_quotatab.html
as mentioned before to see if it does everything you want.
If that is not suitable, there are a number of other methods
including:
- per user quotas implemented by the operating system
- add a periodic job that monitors disk usage and revises the proftpd
configuration / restarts the server to implement "soft" quotas
and other techniques. These are not part of proftpd, but capabilities
of your overall system.
Since the answer to #2 is "there is no proftpd directive" to do what
you want, do you want to puruse one of these alternatives? For
example, if you want to use mod_quotatab, I can describe how to build
proftpd with that enabled so proftpd will implement the quotas
directly.
--Maniac
|