| 1 | <!DOCTYPE html> |
| 2 | <html> |
| 3 | <head> |
| 4 | <title>ProFTPD module mod_xfer</title> |
| 5 | </head> |
| 6 | |
| 7 | <body bgcolor=white> |
| 8 | |
| 9 | <hr> |
| 10 | <center> |
| 11 | <h2><b>ProFTPD module <code>mod_xfer</code></b></h2> |
| 12 | </center> |
| 13 | <hr><br> |
| 14 | |
| 15 | <p> |
| 16 | The <code>mod_xfer</code> module handles most of the FTP commands related to |
| 17 | file transfers. |
| 18 | |
| 19 | <h2>Directives</h2> |
| 20 | <ul> |
| 21 | <li><a href="#AllowOverwrite">AllowOverwrite</a> |
| 22 | <li><a href="#AllowRetrieveRestart">AllowRetrieveRestart</a> |
| 23 | <li><a href="#AllowStoreRestart">AllowStoreRestart</a> |
| 24 | <li><a href="#DefaultTransferMode">DefaultTransferMode</a> |
| 25 | <li><a href="#DeleteAbortedStores">DeleteAbortedStores</a> |
| 26 | <li><a href="#DisplayFileTransfer">DisplayFileTransfer</a> |
| 27 | <li><a href="#HiddenStores">HiddenStores</a> |
| 28 | <li><a href="#MaxRetrieveFileSize">MaxRetrieveFileSize</a> |
| 29 | <li><a href="#MaxStoreFileSize">MaxStoreFileSize</a> |
| 30 | <li><a href="#MaxTransfersPerHost">MaxTransfersPerHost</a> |
| 31 | <li><a href="#MaxTransfersPerUser">MaxTransfersPerUser</a> |
| 32 | <li><a href="#StoreUniquePrefix">StoreUniquePrefix</a> |
| 33 | <li><a href="#TimeoutNoTransfer">TimeoutNoTransfer</a> |
| 34 | <li><a href="#TimeoutStalled">TimeoutStalled</a> |
| 35 | <li><a href="#TransferOptions">TransferOptions</a> |
| 36 | <li><a href="#TransferRate">TransferRate</a> |
| 37 | <li><a href="#UseSendfile">UseSendfile</a> |
| 38 | </ul> |
| 39 | |
| 40 | <p> |
| 41 | <hr> |
| 42 | <h3><a name="AllowOverwrite">AllowOverwrite</a></h3> |
| 43 | <strong>Syntax:</strong> AllowOverwrite <em>on|off</em><br> |
| 44 | <strong>Default:</strong> <code>AllowOverwrite off</code><br> |
| 45 | <strong>Context:</strong> server config, <code><VirtualHost></code>, <code><Global></code>, <code><Anonymous></code>, <code><Directory></code>, <code>.ftpaccess</code><br> |
| 46 | <strong>Module:</strong> mod_xfer<br> |
| 47 | <strong>Compatibility:</strong> 0.99.0 and later |
| 48 | |
| 49 | <p> |
| 50 | The <code>AllowOverwrite</code> directive permits newly transferred files to |
| 51 | overwrite existing files. By default, FTP clients <b>cannot</b> overwrite |
| 52 | existing files. |
| 53 | |
| 54 | <p> |
| 55 | <hr> |
| 56 | <h3><a name="AllowRetrieveRestart">AllowRetrieveRestart</a></h3> |
| 57 | <strong>Syntax:</strong> AllowRetrieveRestart <em>on|off</em><br> |
| 58 | <strong>Default:</strong> <code>AllowRetrieveRestart on</code><br> |
| 59 | <strong>Context:</strong> server config, <code><VirtualHost></code>, <code><Global></code>, <code><Anonymous></code>, <code><Directory></code>, <code>.ftpaccess</code><br> |
| 60 | <strong>Module:</strong> mod_xfer<br> |
| 61 | <strong>Compatibility:</strong> 0.99.0 and later |
| 62 | |
| 63 | <p> |
| 64 | The <code>AllowRetrieveRestart</code> directive permits (or denies) clients |
| 65 | from performing "restart" download (retrieve) file transfers via the FTP |
| 66 | <code>REST</code> command. By default, restarted downloads are allowed, so |
| 67 | that clients may resume interrupted file transfers at a later time without |
| 68 | losing previously collected data. |
| 69 | |
| 70 | <p> |
| 71 | See also: <a href="#AllowStoreRestart"><code>AllowStoreRestart</code></a> |
| 72 | |
| 73 | <p> |
| 74 | <hr> |
| 75 | <h3><a name="AllowStoreRestart">AllowStoreRestart</a></h3> |
| 76 | <strong>Syntax:</strong> AllowStoreRestart <em>on|off</em><br> |
| 77 | <strong>Default:</strong> <code>AllowStoreRestart off</code><br> |
| 78 | <strong>Context:</strong> server config, <code><VirtualHost></code>, <code><Global></code>, <code><Anonymous></code>, <code><Directory></code>, <code>.ftpaccess</code><br> |
| 79 | <strong>Module:</strong> mod_xfer<br> |
| 80 | <strong>Compatibility:</strong> 0.99.0 and later |
| 81 | |
| 82 | <p> |
| 83 | The <code>AllowStoreRestart</code> directive permits (or denies) clients from |
| 84 | "restarting" interrupted upload (store) transfers. By default restarting (via |
| 85 | the FTP <code>REST</code> command) is <b>not</b> permitted when uploading |
| 86 | files to the server. Care should be taken to disallow anonymous FTP |
| 87 | "incoming" transfers to be restarted, as this will allow clients to corrupt or |
| 88 | increase the size of previously stored files (even if not their own). |
| 89 | |
| 90 | <p> |
| 91 | The FTP <code>REST</code> command is automatically blocked when |
| 92 | <code>HiddenStores</code> is enabled, with the server returning a 501 error |
| 93 | code to the client. |
| 94 | |
| 95 | <p> |
| 96 | See also: <a href="#AllowRetrieveRestart"><code>AllowRetrieveRestart</code></a>, |
| 97 | <a href="#DeleteAbortedStores"><code>DeleteAbortedStore</code></a>, |
| 98 | <a href="#HiddenStores"><code>HiddenStores</code></a> |
| 99 | |
| 100 | <p> |
| 101 | <hr> |
| 102 | <h3><a name="DefaultTransferMode">DefaultTransferMode</a></h3> |
| 103 | <strong>Syntax:</strong> DefaultTransferMode <em>ascii|binary</em><br> |
| 104 | <strong>Default:</strong> <code>DefaultTransferMode ascii</code><br> |
| 105 | <strong>Context:</strong> server config, <code><VirtualHost></code>, <code><Global></code><br> |
| 106 | <strong>Module:</strong> mod_xfer<br> |
| 107 | <strong>Compatibility:</strong> 1.2.0pre9 and later |
| 108 | |
| 109 | <p> |
| 110 | The <code>DefaultTransferMode</code> directive sets the <em>default</em> |
| 111 | transfer mode used for data transfers. Per RFC 959 requirements, the default |
| 112 | transfer mode is "ascii", which means that carriage return (<code>CR</code>) |
| 113 | and line feed (<code>LF</code>) translation will be performed: <code>CRLF</code> |
| 114 | sequences in <em>uploaded</em> data will be translated to <code>LF</code>, |
| 115 | and <code>LF</code> translated to <code>CRLF</code> in <em>downloaded</em> data. |
| 116 | |
| 117 | <p> |
| 118 | <hr> |
| 119 | <h3><a name="DeleteAbortedStores">DeleteAbortedStores</a></h3> |
| 120 | <strong>Syntax:</strong> DeleteAbortedStores <em>on|off</em><br> |
| 121 | <strong>Default:</strong> <code>DeleteAbortedStores off</code><br> |
| 122 | <strong>Context:</strong> server config, <code><VirtualHost></code>, <code><Global></code>, <code><Anonymous></code>, <code><Directory></code>, <code>.ftpaccess</code><br> |
| 123 | <strong>Module:</strong> mod_xfer<br> |
| 124 | <strong>Compatibility:</strong> 1.2.0rc2 and later |
| 125 | |
| 126 | <p> |
| 127 | The <code>DeleteAbortedStores</code> directive controls whether ProFTPD |
| 128 | deletes partially uploaded files if the transfer is stopped via the |
| 129 | FTP <code>ABOR</code> command (as opposed to a connection failure). |
| 130 | By default, <code>DeleteAbortedStores</code> is <em>off</em>. |
| 131 | |
| 132 | <p> |
| 133 | <b>However</b>, when <code>HiddenStores</code> is enabled, then |
| 134 | <code>DeleteAbortedStores</code> is automatically enabled as well. |
| 135 | |
| 136 | <p> |
| 137 | See also: <a href="#HiddenStores"><code>HiddenStores</code></a> |
| 138 | |
| 139 | <p> |
| 140 | <hr> |
| 141 | <h3><a name="HiddenStores">HiddenStores</a></h3> |
| 142 | <strong>Syntax:</strong> HiddenStores <em>on|off|prefix [suffix]</em><br> |
| 143 | <strong>Default:</strong> <code>HiddenStores off</code><br> |
| 144 | <strong>Context:</strong> server config, <code><VirtualHost></code>, <code><Global></code>, <code><Anonymous></code>, <code><Directory></code><br> |
| 145 | <strong>Module:</strong> mod_xfer<br> |
| 146 | <strong>Compatibility:</strong> 1.2.7rc1 and later |
| 147 | |
| 148 | <p> |
| 149 | The <code>HiddenStores</code> directive enables two-step file uploads: files |
| 150 | are uploaded as ".in.<em>filename</em>." and once the upload is complete, |
| 151 | renamed to just <em>filename</em>. This provides a degree of atomicity and |
| 152 | helps prevent <i>1)</i> incomplete uploads and <i>2)</i> files being used |
| 153 | while they are still being uploaded. When <code>HiddenStores</code> is |
| 154 | enabled, then <a href="#DeleteAbortedStores"><code>DeleteAbortedStores</code></a> is automatically enabled as well. |
| 155 | |
| 156 | <p> |
| 157 | Note that if the temporary file name is already in use (<i>e.g.</i>, a server |
| 158 | crash during upload), it will prevent the file from being uploaded. |
| 159 | |
| 160 | <p> |
| 161 | The FTP <code>REST</code> command is automatically blocked when |
| 162 | <code>HiddenStores</code> is enabled, with the server returning a 501 error |
| 163 | code to the client. |
| 164 | |
| 165 | <p> |
| 166 | In <code>proftpd-1.3.3rc2</code> and later, the ".in." <em>prefix</em> can be |
| 167 | customised via the <code>HiddenStores</code> directive, <i>e.g.</i>: |
| 168 | <pre> |
| 169 | # Use a different prefix for HiddenStores |
| 170 | HiddenStores filepart- |
| 171 | </pre> |
| 172 | |
| 173 | <p> |
| 174 | In <code>proftpd-1.3.5rc2</code> and later, the "." <em>suffix</em> can be |
| 175 | customised using the <code>HiddenStores</code> directive as well, <i>e.g.</i>: |
| 176 | <pre> |
| 177 | # Use a different prefix <b>and</b> suffix for HiddenStores |
| 178 | HiddenStores incoming- .lock |
| 179 | </pre> |
| 180 | You can also use this capability to configure <em>no</em> prefix, and just |
| 181 | a suffix: |
| 182 | <pre> |
| 183 | # Use an empty string as the prefix, and a suffix of ".filepart". |
| 184 | HiddenStores "" ".filepart" |
| 185 | </pre> |
| 186 | <b>Note</b> that in order to specify the suffix, you <b>must</b> specify a |
| 187 | prefix as well. |
| 188 | |
| 189 | <p> |
| 190 | In <code>proftpd-1.3.6rc1</code> and later, the <em>prefix</em> and |
| 191 | <em>suffix</em> values can use the <code>%P</code> variable, which will |
| 192 | be substituted with the session PID. This can help to reduce issues |
| 193 | encountered when an FTP upload fails in such a way that proftpd cannot properly |
| 194 | clean up the <code>HiddenStores</code> temporary file. For example: |
| 195 | <pre> |
| 196 | # Use the session PID as part of the name |
| 197 | HiddenStores .in. .%P |
| 198 | </pre> |
| 199 | |
| 200 | <p> |
| 201 | <b><i>Discussion</i></b><br> |
| 202 | When would you want or need to specify different prefix and suffix values |
| 203 | for <code>HiddenStores</code>? You might need this when, for example, your |
| 204 | <code>proftpd</code> writes files to an NFS-mounted filesystem. Another |
| 205 | machine mounts that same filesystem remotely using a CIFS client (<i>e.g.</i> |
| 206 | a NetApp machine). The trailing "." suffix causes the CIFS client to list |
| 207 | the temporary filenames different (<i>e.g.</i> in a Windows 8.3 file format |
| 208 | style): "in.test." becomes "INTES~1". This view confuses users/admins. |
| 209 | |
| 210 | <p> |
| 211 | By changing the default <code>HiddenStores</code> suffix, then, that modified |
| 212 | CIFS client filename view can be avoided. |
| 213 | |
| 214 | <p> |
| 215 | See also: <a href="#AllowStoreRestart"><code>AllowStoreRestart</code></a>, |
| 216 | <a href="#DeleteAbortedStores"><code>DeleteAbortedStores</code></a> |
| 217 | |
| 218 | <p> |
| 219 | <hr> |
| 220 | <h3><a name="MaxRetrieveFileSize">MaxRetrieveFileSize</a></h3> |
| 221 | <strong>Syntax:</strong> MaxRetrieveFileSize <em>[number|"*" units ["user"|"group"|"class" expression]]</em><br> |
| 222 | <strong>Default:</strong> None<br> |
| 223 | <strong>Context:</strong> server config, <code><VirtualHost></code>, <code><Global></code>, <code><Anonymous></code>, <code><Directory></code>, <code>.ftpaccess</code><br> |
| 224 | <strong>Module:</strong> mod_xfer<br> |
| 225 | <strong>Compatibility:</strong> 1.2.7rc1 and later |
| 226 | |
| 227 | <p> |
| 228 | The <code>MaxRetrieveFileSize</code> directive sets a maximum limit on the |
| 229 | size of a <b>single file</b> downloaded from <code>proftpd</code>. If the |
| 230 | requested file size is larger than than the configured maximum limit, |
| 231 | the data transfer will be rejected. |
| 232 | |
| 233 | <p> |
| 234 | A single "*" argument configures unlimited file sizes, and is used primarily to |
| 235 | override any inherited restrictions from higher-level configuration sections. |
| 236 | The given <em>number</em> is the number of bytes for the limit, and is followed |
| 237 | by a units specifier of (case-insensitive) "Gb" (Gigabytes), "Mb" (Megabytes), |
| 238 | "Kb" (Kilobytes), or "B" (bytes). The given <em>number</em> of bytes is |
| 239 | multiplied by the appropriate factor. |
| 240 | |
| 241 | <p> |
| 242 | The optional parameters are used to restrict the file size limits only to |
| 243 | specific users. If the "user" restriction is given, then <em>expression</em> is |
| 244 | a <i>user-expression</i> specifying to which users the rule applies. Similarly |
| 245 | for the "group" restriction. For the "class" restriction, the |
| 246 | <em>expression</em> is simply the name of connection class for whom the rule |
| 247 | will apply. If no matching user, group, or class expression (in that order) is |
| 248 | found for the current user, then a limit with no expression (<i>i.e.</i> no |
| 249 | "user", "group", or "class" identifier) is applied. |
| 250 | |
| 251 | <p> |
| 252 | Examples: |
| 253 | <pre> |
| 254 | # Restrict downloads to only 1 gigabyte |
| 255 | MaxRetrieveFileSize 1 Gb |
| 256 | |
| 257 | # Restrict downloads for user fred, but allow unlimited download size for |
| 258 | # everyone else |
| 259 | MaxRetrieveFileSize 50 Kb user fred |
| 260 | MaxRetrieveFileSize * |
| 261 | </pre> |
| 262 | |
| 263 | <p> |
| 264 | See also: <a href="#MaxStoreFileSize"><code>MaxStoreFileSize</code></a> |
| 265 | |
| 266 | <p> |
| 267 | <hr> |
| 268 | <h3><a name="MaxStoreFileSize">MaxStoreFileSize</a></h3> |
| 269 | <strong>Syntax:</strong> MaxStoreFileSize <em>[number|"*" units ["user"|"group"|"class" expression]]</em><br> |
| 270 | <strong>Default:</strong> None<br> |
| 271 | <strong>Context:</strong> server config, <code><VirtualHost></code>, <code><Global></code>, <code><Anonymous></code>, <code><Directory></code>, <code>.ftpaccess</code><br> |
| 272 | <strong>Module:</strong> mod_xfer<br> |
| 273 | <strong>Compatibility:</strong> 1.2.7rc1 and later |
| 274 | |
| 275 | <p> |
| 276 | The <code>MaxStoreFileSize</code> directive sets a maximum limit on the |
| 277 | size of a <b>single file</b> uploaded to <code>proftpd</code>. When the |
| 278 | configured maximum limit is reached, the data transfer will be aborted. |
| 279 | |
| 280 | <p> |
| 281 | A single "*" argument configures unlimited file sizes, and is used primarily to |
| 282 | override any inherited restrictions from higher-level configuration sections. |
| 283 | The given <em>number</em> is the number of bytes for the limit, and is followed |
| 284 | by a units specifier of (case-insensitive) "Gb" (Gigabytes), "Mb" (Megabytes), |
| 285 | "Kb" (Kilobytes), or "B" (bytes). The given <em>number</em> of bytes is |
| 286 | multiplied by the appropriate factor. |
| 287 | |
| 288 | <p> |
| 289 | The optional parameters are used to restrict the file size limits only to |
| 290 | specific users. If the "user" restriction is given, then <em>expression</em> |
| 291 | is a <i>user-expression</i> specifying to which users the rule applies. |
| 292 | Similarly for the "group" restriction. For the "class" restriction, the |
| 293 | <em>expression</em> is simply the name of connection class for whom the rule |
| 294 | will apply. If no matching user, group, or class expression (in that order) is |
| 295 | found for the current user, then a limit with no expression (<i>i.e.</i> |
| 296 | no "user", "group", or "class" identifier) is applied. |
| 297 | |
| 298 | <p> |
| 299 | Examples: |
| 300 | <pre> |
| 301 | # Restrict upload to only 3 megabytes |
| 302 | MaxStoreFileSize 3 Mb |
| 303 | |
| 304 | # Restrict anonymous uploads to 50k, but allow unlimited upload size for |
| 305 | # everyone else |
| 306 | MaxStoreFileSize 50 Kb user anonymous |
| 307 | MaxStoreFileSize * |
| 308 | </pre> |
| 309 | |
| 310 | <p> |
| 311 | <b>NOTE</b>: In FTP uploads, the size of the file being uploaded is <b>not</b> |
| 312 | sent to the FTP server first; this means that the FTP server does not know in |
| 313 | advance how much data the FTP client is going to send. The FTP server can only |
| 314 | count the number of bytes being uploaded, and stop the transfer when a |
| 315 | configured limit is reached. This means that <code>MaxStoreFileSize</code> |
| 316 | <b>cannot</b> be used to prevent an FTP client from even sending the bytes |
| 317 | over the network. |
| 318 | |
| 319 | <p> |
| 320 | See also: <a href="#MaxRetrieveFileSize"><code>MaxRetrieveFileSize</code></a> |
| 321 | |
| 322 | <p> |
| 323 | <hr> |
| 324 | <h3><a name="MaxTransfersPerHost">MaxTransfersPerHost</a></h3> |
| 325 | <strong>Syntax:</strong> MaxTransfersPerHost <em>cmd-list count [message]</em><br> |
| 326 | <strong>Default:</strong> None<br> |
| 327 | <strong>Context:</strong> server config, <code><VirtualHost></code>, <code><Global></code>, <code><Anonymous></code>, <code><Directory></code>, <code>.ftpaccess</code><br> |
| 328 | <strong>Module:</strong> mod_xfer<br> |
| 329 | <strong>Compatibility:</strong> 1.3.2rc1 and later |
| 330 | |
| 331 | <p> |
| 332 | The <code>MaxTransfersPerHost</code> directive limits the number of data |
| 333 | transfers happening at the same time <i>from the same host</i>. The |
| 334 | <em>cmd-list</em> parameter is a comma-separated list of the data transfer FTP |
| 335 | commands (APPE, RETR, STOR, and/or STOU) to which the limit applies. The |
| 336 | optional <em>message</em> parameter may be used, which will be displayed to a |
| 337 | client attempting to exceed the maximum value. If <em>message</em> is |
| 338 | <i>not</i> supplied, the following message is used by default: |
| 339 | <pre> |
| 340 | "Sorry, the maximum number of data transfers (%m) from your host are currently being used." |
| 341 | </pre> |
| 342 | |
| 343 | <p> |
| 344 | For example: |
| 345 | <pre> |
| 346 | MaxTransfersPerHost RETR 2 |
| 347 | </pre> |
| 348 | will result in the following FTP response to a client exceeding the download |
| 349 | limit: |
| 350 | <pre> |
| 351 | "451 Sorry, the maximum number of data transfers (2) from your host are currently being used." |
| 352 | </pre> |
| 353 | And for uploads, you might using something like: |
| 354 | <pre> |
| 355 | MaxTransferPerHost APPE,STOR,STOU 1 |
| 356 | </pre> |
| 357 | |
| 358 | <p> |
| 359 | See also: <a href="#MaxTransfersPerUser"><code>MaxTransfersPerUser</code></a> |
| 360 | |
| 361 | <p> |
| 362 | <hr> |
| 363 | <h3><a name="MaxTransfersPerUser">MaxTransfersPerUser</a></h3> |
| 364 | <strong>Syntax:</strong> MaxTransfersPerUser <em>cmd-list count [message]</em><br> |
| 365 | <strong>Default:</strong> None<br> |
| 366 | <strong>Context:</strong> server config, <code><VirtualHost></code>, <code><Global></code>, <code><Anonymous></code>, <code><Directory></code>, <code>.ftpaccess</code><br> |
| 367 | <strong>Module:</strong> mod_xfer<br> |
| 368 | <strong>Compatibility:</strong> 1.3.2rc1 and later |
| 369 | |
| 370 | <p> |
| 371 | The <code>MaxTransfersPerUser</code> directive limits the number of data |
| 372 | transfers happening at the same time <i>for the same user name</i>. The |
| 373 | <em>cmd-list</em> parameter is a comma-separated list of the data transfer FTP |
| 374 | commands (APPE, RETR, STOR, and/or STOU) to which the limit applies. The |
| 375 | optional <em>message</em> parameter may be used, which will be displayed to a |
| 376 | client attempting to exceed the maximum value. If <em>message</em> is |
| 377 | <i>not</i> supplied, the following message is used by default: |
| 378 | <pre> |
| 379 | "Sorry, the maximum number of data transfers (%m) from this user are currently being used." |
| 380 | </pre> |
| 381 | |
| 382 | <p> |
| 383 | For example: |
| 384 | <pre> |
| 385 | MaxTransfersPerUser RETR 2 |
| 386 | </pre> |
| 387 | will result in the following FTP response to a client exceeding the download |
| 388 | limit: |
| 389 | <pre> |
| 390 | "451 Sorry, the maximum number of data transfers (2) from this user are currently being used." |
| 391 | </pre> |
| 392 | And for uploads, you might using something like: |
| 393 | <pre> |
| 394 | MaxTransferPerUser APPE,STOR,STOU 1 |
| 395 | </pre> |
| 396 | |
| 397 | <p> |
| 398 | See also: <a href="#MaxTransfersPerHost"><code>MaxTransfersPerHost</code></a> |
| 399 | |
| 400 | <p> |
| 401 | <hr> |
| 402 | <h3><a name="StoreUniquePrefix">StoreUniquePrefix</a></h3> |
| 403 | <strong>Syntax:</strong> StoreUniquePrefix <em>prefix</em><br> |
| 404 | <strong>Default:</strong> None<br> |
| 405 | <strong>Context:</strong> server config, <code><VirtualHost></code>, <code><Global></code>, <code><Anonymous></code>, <code><Directory></code>, <code>.ftpaccess</code><br> |
| 406 | <strong>Module:</strong> mod_xfer<br> |
| 407 | <strong>Compatibility:</strong> 1.2.6rc1 and later |
| 408 | |
| 409 | <p> |
| 410 | The <code>StoreUniquePrefix</code> directive is used to configure a |
| 411 | <em>prefix</em> for the generated unique random filenames used for the STOU |
| 412 | FTP command. The last six characters of the filename will be random. |
| 413 | <b>Note</b>: Slash (/) characters are <b>not</b> allowed in the <em>prefix</em> |
| 414 | value. |
| 415 | |
| 416 | <p> |
| 417 | <hr> |
| 418 | <h3><a name="TimeoutNoTransfer">TimeoutNoTransfer</a></h3> |
| 419 | <strong>Syntax:</strong> TimeoutNoTransfer <em>seconds</em><br> |
| 420 | <strong>Default:</strong> 300 seconds<br> |
| 421 | <strong>Context:</strong> server config, <code><VirtualHost></code>, <code><Global></code><br> |
| 422 | <strong>Module:</strong> mod_xfer<br> |
| 423 | <strong>Compatibility:</strong> 0.99.0 and later |
| 424 | |
| 425 | <p> |
| 426 | The <code>TimeoutNoTransfer</code> directive configures the maximum number of |
| 427 | <em>seconds</em> a client is allowed to spend connected, after authentication, |
| 428 | without issuing a data transfer command which results in a data connection |
| 429 | (<i>i.e.</i> sending/receiving a file, or requesting a directory listing). |
| 430 | The maximum allowed <em>seconds</em> value is 65535 (18 hours). |
| 431 | |
| 432 | <p> |
| 433 | See also: <a href="mod_core.html#TimeoutIdle"><code>TimeoutIdle</code></a>, |
| 434 | <a href="mod_auth.html#TimeoutLogin"><code>TimeoutLogin</code></a>, |
| 435 | <a href="#TimeoutStalled"><code>TimeoutStalled</code></a>. |
| 436 | |
| 437 | <p> |
| 438 | <hr> |
| 439 | <h3><a name="TimeoutStalled">TimeoutStalled</a></h3> |
| 440 | <strong>Syntax:</strong> TimeoutStalled <em>seconds</em><br> |
| 441 | <strong>Default:</strong> 3600 seconds<br> |
| 442 | <strong>Context:</strong> server config, <code><VirtualHost></code>, <code><Global></code><br> |
| 443 | <strong>Module:</strong> mod_xfer<br> |
| 444 | <strong>Compatibility:</strong> 1.1.6 and later |
| 445 | |
| 446 | <p> |
| 447 | The <code>TimeoutStalled</code> directive sets the maximum number of |
| 448 | <em>seconds</em> a data connection between <code>proftpd</code> and a client |
| 449 | can exist but have no actual data transferred (<i>i.e.</i> "stalled"). If the |
| 450 | <em>seconds</em> parameter is set to zero, data transfers are allowed to stall |
| 451 | indefinitely; <b>note</b> that this is <b>not</b> a recommended configuration. |
| 452 | The maximum allowed <em>seconds</em> value is 65535 (18 hours). |
| 453 | |
| 454 | <p> |
| 455 | <hr> |
| 456 | <h3><a name="TransferOptions">TransferOptions</a></h3> |
| 457 | <strong>Syntax:</strong> TransferOptions <em>opt1 ...</em><br> |
| 458 | <strong>Default:</strong> None<br> |
| 459 | <strong>Context:</strong> server config, <code><VirtualHost></code>, <code><Global></code><br> |
| 460 | <strong>Module:</strong> mod_xfer<br> |
| 461 | <strong>Compatibility:</strong> 1.3.6rc1 and later |
| 462 | |
| 463 | <p> |
| 464 | The <code>TransferOptions</code> directive to configure various optional data |
| 465 | transfer behaviors. |
| 466 | |
| 467 | <p> |
| 468 | The currently implemented options are: |
| 469 | <ul> |
| 470 | <li><code>AllowSymlinkUpload</code><br> |
| 471 | <p> |
| 472 | This option allows clients to upload files which are actually symlinks |
| 473 | on the server, rather than returning a "Not a regular file" error. |
| 474 | |
| 475 | <p> |
| 476 | <b>Note</b> that this option first appeared in |
| 477 | <code>proftpd-1.3.8rc3</code>. |
| 478 | </li> |
| 479 | |
| 480 | <li><code>IgnoreASCII</code><br> |
| 481 | <p> |
| 482 | This option causes ProFTPD to silently ignore any client requests to |
| 483 | perform ASCII translations via the <code>TYPE</code> command. That is, |
| 484 | FTP clients can request ASCII translations, and proftpd will respond |
| 485 | as the client expects, but will <b>not</b> actually perform the translation |
| 486 | for either uploads <i>or</i> downloads. This behavior can be useful in |
| 487 | circumstances involving older/mainframe clients and EBCDIC files. |
| 488 | |
| 489 | <p> |
| 490 | <b>Note</b> that this option first appeared in |
| 491 | <code>proftpd-1.3.6rc1</code>. |
| 492 | </li> |
| 493 | </ul> |
| 494 | |
| 495 | <p> |
| 496 | <hr> |
| 497 | <h3><a name="TransferRate">TransferRate</a></h3> |
| 498 | <strong>Syntax:</strong> TransferRate <em>cmd-list kbytes-per-sec[:free-bytes]</em><br> |
| 499 | <strong>Default:</strong> None<br> |
| 500 | <strong>Context:</strong> server config, <code><VirtualHost></code>, <code><Global></code>, <code><Anonymous></code>, <code><Directory></code>, .ftpaccess<br> |
| 501 | <strong>Module:</strong> mod_xfer<br> |
| 502 | <strong>Compatibility:</strong> 1.2.8rc1 and later |
| 503 | |
| 504 | <p> |
| 505 | The <code>TransferRate</code> directive is used to set transfer rate limits |
| 506 | on the transfer of data. This directive allows for transfer rates to be set |
| 507 | in a wide variety of contexts, on a per-command basis, and for certain subsets |
| 508 | of users (via |
| 509 | <a href="../contrib/mod_ifsession.html"><code>mod_ifsession</code></a>). |
| 510 | <b>Note</b> that these limits only apply to <i>an individual session</i>, and |
| 511 | do <b>not</b> apply to the overall transfer rate of the entire daemon. |
| 512 | |
| 513 | <p> |
| 514 | The <em>cmd-list</em> parameter may be an comma-separated list of any of the |
| 515 | following commands: <code>APPE</code>, <code>RETR</code>, <code>STOR</code>, |
| 516 | and <code>STOU</code>. |
| 517 | |
| 518 | <p> |
| 519 | The <em>kbytes-per-sec</em> parameter is the actual transfer rate to be applied. |
| 520 | |
| 521 | <p> |
| 522 | The <em>free-bytes</em> parameter, if configured, allows that number of bytes |
| 523 | to be transferred before the rate limit is applied. This allows for clients |
| 524 | transferring small files to be unthrottled, but for larger files, such as MP3s |
| 525 | and ISO images, to be throttled. |
| 526 | |
| 527 | <p> |
| 528 | Here are some examples: |
| 529 | <pre> |
| 530 | # Limit downloads for everyone |
| 531 | TransferRate RETR 1.5 |
| 532 | |
| 533 | # Limit uploads (and appends!) to the prolific users in the |
| 534 | # lotsofuploadfiles.net domain. This presumes that a Class has been defined |
| 535 | # for that domain, and that that Class has been named "uploaders". Let them |
| 536 | # upload small files without throttling, though. |
| 537 | |
| 538 | <IfClass uploaders> |
| 539 | TransferRate APPE,STOR 8.0:1024 |
| 540 | </IfClass> |
| 541 | </pre> |
| 542 | |
| 543 | <p> |
| 544 | <hr> |
| 545 | <h3><a name="UseSendfile">UseSendfile</a></h3> |
| 546 | <strong>Syntax:</strong> UseSendfile <em>on|off|len units|percentage</em><br> |
| 547 | <strong>Default:</strong> None<br> |
| 548 | <strong>Context:</strong> server config, <code><VirtualHost></code>, <code><Global></code>, <code><Anonymous></code>, <code><Directory></code>, .ftpaccess<br> |
| 549 | <strong>Module:</strong> mod_xfer<br> |
| 550 | <strong>Compatibility:</strong> 1.3.0rc1 and later |
| 551 | |
| 552 | <p> |
| 553 | The <code>UseSendfile</code> directive controls use of <code>sendfile(2)</code> |
| 554 | functionality, which is an optimization for sending files to clients. Use of |
| 555 | <code>sendfile(2)</code> functionality avoids separate read and send kernel |
| 556 | operations, and buffer allocations. Read this |
| 557 | <a href="../howto/Sendfile.html">howto</a> for more details. |
| 558 | |
| 559 | <p> |
| 560 | <hr> |
| 561 | <h2><a name="Installation">Installation</a></h2> |
| 562 | The <code>mod_xfer</code> module is <b>always</b> installed. |
| 563 | |
| 564 | <p> |
| 565 | <b>Logging</b><br> |
| 566 | The <code>mod_xfer</code> module supports <a href="../howto/Tracing.html">trace logging</a>, via the module-specific log channels: |
| 567 | <ul> |
| 568 | <li>xfer |
| 569 | </ul> |
| 570 | Thus for trace logging, to aid in debugging, you would use the following in |
| 571 | your <code>proftpd.conf</code>: |
| 572 | <pre> |
| 573 | TraceLog /path/to/ftpd/trace.log |
| 574 | Trace xfer:20 |
| 575 | </pre> |
| 576 | This trace logging can generate large files; it is intended for debugging use |
| 577 | only, and should be removed from any production configuration. |
| 578 | |
| 579 | <p> |
| 580 | <hr> |
| 581 | <font size=2><b><i> |
| 582 | © Copyright 2000-2023 The ProFTPD Project<br> |
| 583 | All Rights Reserved<br> |
| 584 | </i></b></font> |
| 585 | <hr> |
| 586 | |
| 587 | </body> |
| 588 | </html> |