0

I create FTP users with a php script. I would like to give my users unique FTP folders. However I would like to limit the folders sizes to 1024MB/folder. How can I limit a folder size?

I use proftp with i-mscp. I create SQL rows for my FTP users.

user1709024
  • 127
  • 10
  • possible duplicate of [Linux - quota per directory?](http://serverfault.com/questions/100596/linux-quota-per-directory) – Tom O'Connor Feb 22 '13 at 23:54
  • I thing, I don't need partitions for my FTP folders. – user1709024 Feb 23 '13 at 00:01
  • I have got a free filesharing webpage. I would like to let the users upload with ftp. However my users can upload 1024 large files maximum. I would like to let them 1024MB FTP upload / day. – user1709024 Feb 23 '13 at 00:13
  • Now you're making it more confusing. Are you limiting the folder size, or the traffic per day? – Jeff Ferland Feb 23 '13 at 00:15
  • "free filesharing webpage" -- You don't have root on this box? Well. Good luck with that. – Tom O'Connor Feb 23 '13 at 00:17
  • I don't know what do you mean with box. But that is my own server. It would be enough to limit traffic / day / user, but it's maybe better to limit the size of folder. Somehow I need to limit them...:-) – user1709024 Feb 23 '13 at 00:19

2 Answers2

2

Linux supports quotas for any applications which use the OS user for authentication / session / authorization. Googling for 'Linux quotas' turns up lots of good tutorials in the first page of matches.

And the good thing about using proper OS users / OS quotas is that you can continue to maintain the upload / storage functionality while you provide other methods of managing files and phase out FTP which is a dangerous and stupid protocol that belongs in the past.

symcbean
  • 19,931
  • 1
  • 29
  • 49
  • What do you thing about this one? http://www.debian-administration.org/articles/47 Should it work? My users ask me for FTP protocol... :-s – user1709024 Feb 23 '13 at 00:38
  • Does quota means automaticaly delete files that larger than quota? – user1709024 Feb 23 '13 at 00:40
  • No it doesn't delete files it just won't allow you to create more when you reach the quota. As to which tutorial to read - read several. – symcbean Feb 23 '13 at 00:42
1

Setting FTP quotas with ProFTPd. You should be able to work it out from there.

Tom O'Connor
  • 27,440
  • 10
  • 72
  • 148
  • I don't thing I need new partitions. I have got options to make limit of my users webpage sizes. 100MB / host, or 1024Mb/host.. etc. However the don't own partitions. Somehow simple apache software do it. OR not? – user1709024 Feb 23 '13 at 00:01
  • Probably not. At least not with any mechanism I've come across so far. Apache is a great webserver.. less so for managing directory usage. You could probably write something in PHP *shudder* – Tom O'Connor Feb 23 '13 at 00:02