配置proftpd限制上傳文件大小

軟件FTP的用戶中轉文件目錄,本只准備給用戶做臨時的文檔中轉和保存,沒想到卻經常被學生傳上游戲及電影一類的大文件,使有限的空間很快被佔滿,故需要對上傳文件的大小做限制,在proftpd的主頁上找到MaxStoreFileSize 命令,可限制相關目錄設置中用戶上傳文件的大小 MaxStoreFileSize Name MaxStoreFileSize -- Restrict size of uploaded files Synopsis MaxStoreFileSize [ number|"*" units ["user"|"group"|"class" expression]] Default None Context server config, , , , , .ftpaccess Module mod_xfer Compatibility 1.2.7rc1 and later Description When uploading files from a client (eg serving a STOR request), the server will check for any configured limit against the size of the file being sent, and abort any transfers if/when the given file's size exceeds the configured limit. A single "*" argument configures unlimited file sizes, and is used primarily to override any inherited restrictions from higher contexts. The given number is the number of bytes for the limit, and is followed by a units specifier of (case-insensitive) "Gb" (Gigabytes), "Mb" (Megabytes), "Kb" (Kilobytes), or "B" (bytes). The given number of bytes is multiplied by the appropriate factor. The optional parameters are used to restrict the file size limits only to specific users. If the "user" restriction is given, then expression is a user-expression specifying to which users the rule applies. Similarly for the "group" restriction. For the "class" restriction, the expression is simply the name of connection class for whom the rule will apply. If no matching user, group, or class expression is found for the current user (in that order), then a limit with no expression (ie no "user", "group", or "class" identifier) is applied. See Also: MaxRetrieveFileSize See also Examples # Restrict upload to only 3 megabytes MaxStoreFileSize 3 Mb # Restrict anonymous uploads to 50k, but allow unlimited upload size for # everyone else MaxStoreFileSize 50 Kb user anonymous MaxStoreFileSize *
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章