Debian Codegraph @

doc/modules/mod_core.html

raw symbols SCIP
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <title>ProFTPD module mod_core</title>
5 </head>
6
7 <body bgcolor=white>
8
9 <hr>
10 <center>
11 <h2><b>ProFTPD module <code>mod_core</code></b></h2>
12 </center>
13 <hr><br>
14
15 <p>
16 The <code>mod_core</code> module handles most of the core FTP commands.
17
18 <h2>Directives</h2>
19 <ul>
20 <li><a href="#Allow">Allow</a>
21 <li><a href="#AllowAll">AllowAll</a>
22 <li><a href="#AllowClass">AllowClass</a>
23 <li><a href="#AllowFilter">AllowFilter</a>
24 <li><a href="#AllowForeignAddress">AllowForeignAddress</a>
25 <li><a href="#AllowGroup">AllowGroup</a>
26 <li><a href="#AllowOverride">AllowOverride</a>
27 <li><a href="#AllowUser">AllowUser</a>
28 <li><a href="#Anonymous">&lt;Anonymous&gt;</a>
29 <li><a href="#AuthOrder">AuthOrder</a>
30 <li><a href="#Class">&lt;Class&gt;</a>
31 <li><a href="#CommandBufferSize">CommandBufferSize</a>
32 <li><a href="#DebugLevel">DebugLevel</a>
33 <li><a href="#DefaultAddress">DefaultAddress</a>
34 <li><a href="#DefaultServer">DefaultServer</a>
35 <li><a href="#Define">Define</a>
36 <li><a href="#Deny">Deny</a>
37 <li><a href="#DenyAll">DenyAll</a>
38 <li><a href="#DenyClass">DenyClass</a>
39 <li><a href="#DenyFilter">DenyFilter</a>
40 <li><a href="#DenyGroup">DenyGroup</a>
41 <li><a href="#DenyUser">DenyUser</a>
42 <li><a href="#Directory">&lt;Directory&gt;</a>
43 <li><a href="#DisplayChdir">DisplayChdir</a>
44 <li><a href="#DisplayConnect">DisplayConnect</a>
45 <li><a href="#DisplayQuit">DisplayQuit</a>
46 <li><a href="#FSCachePolicy">FSCachePolicy</a>
47 <li><a href="#FSOptions">FSOptions</a>
48 <li><a href="#Global">&lt;Global&gt;</a>
49 <li><a href="#Group">Group</a>
50 <li><a href="#GroupOwner">GroupOwner</a>
51 <li><a href="#HideFiles">HideFiles</a>
52 <li><a href="#HideGroup">HideGroup</a>
53 <li><a href="#HideNoAccess">HideNoAccess</a>
54 <li><a href="#HideUser">HideUser</a>
55 <li><a href="#IgnoreHidden">IgnoreHidden</a>
56 <li><a href="#IfDefine">&lt;IfDefine&gt;</a>
57 <li><a href="#IfModule">&lt;IfModule&gt;</a>
58 <li><a href="#Include">Include</a>
59 <li><a href="#IncludeOptions">IncludeOptions</a>
60 <li><a href="#Limit">&lt;Limit&gt;</a>
61 <li><a href="#MasqueradeAddress">MasqueradeAddress</a>
62 <li><a href="#MaxCommandRate">MaxCommandRate</a>
63 <li><a href="#MaxConnectionRate">MaxConnectionRate</a>
64 <li><a href="#MaxInstances">MaxInstances</a>
65 <li><a href="#Order">Order</a>
66 <li><a href="#PassivePorts">PassivePorts</a>
67 <li><a href="#PathAllowFilter">PathAllowFilter</a>
68 <li><a href="#PathDenyFilter">PathDenyFilter</a>
69 <li><a href="#PidFile">PidFile</a>
70 <li><a href="#Port">Port</a>
71 <li><a href="#ProcessTitles">ProcessTitles</a>
72 <li><a href="#Protocols">Protocols</a>
73 <li><a href="#RegexOptions">RegexOptions</a>
74 <li><a href="#ScoreboardFile">ScoreboardFile</a>
75 <li><a href="#ScoreboardMutex">ScoreboardMutex</a>
76 <li><a href="#ScoreboardOptions">ScoreboardOptions</a>
77 <li><a href="#ScoreboardScrub">ScoreboardScrub</a>
78 <li><a href="#ServerAdmin">ServerAdmin</a>
79 <li><a href="#ServerAlias">ServerAlias</a>
80 <li><a href="#ServerIdent">ServerIdent</a>
81 <li><a href="#ServerName">ServerName</a>
82 <li><a href="#ServerType">ServerType</a>
83 <li><a href="#SetEnv">SetEnv</a>
84 <li><a href="#SocketBindTight">SocketBindTight</a>
85 <li><a href="#SocketOptions">SocketOptions</a>
86 <li><a href="#SyslogFacility">SyslogFacility</a>
87 <li><a href="#SyslogLevel">SyslogLevel</a>
88 <li><a href="#TCPBacklog">TCPBacklog</a>
89 <li><a href="#TCPNoDelay">TCPNoDelay</a>
90 <li><a href="#TimeoutIdle">TimeoutIdle</a>
91 <li><a href="#TimeoutLinger">TimeoutLinger</a>
92 <li><a href="#TimesGMT">TimesGMT</a>
93 <li><a href="#Trace">Trace</a>
94 <li><a href="#TraceLog">TraceLog</a>
95 <li><a href="#TraceOptions">TraceOptions</a>
96 <li><a href="#TransferLog">TransferLog</a>
97 <li><a href="#Umask">Umask</a>
98 <li><a href="#UnsetEnv">UnsetEnv</a>
99 <li><a href="#UseIPv6">UseIPv6</a>
100 <li><a href="#User">User</a>
101 <li><a href="#UseReverseDNS">UseReverseDNS</a>
102 <li><a href="#UserOwner">UserOwner</a>
103 <li><a href="#VirtualHost">&lt;VirtualHost&gt;</a>
104 </ul>
105
106 <p>
107 <hr>
108 <h3><a name="Allow">Allow</a></h3>
109 <strong>Syntax:</strong> Allow <em>[from] "all"|"none"|host|network|...]</em><br>
110 <strong>Default:</strong> Allow from all<br>
111 <strong>Context:</strong> <code>&lt;Limit&gt;</code><br>
112 <strong>Module:</strong> mod_core<br>
113 <strong>Compatibility:</strong> 0.99.0p16 and later
114
115 <p>
116 The <code>Allow</code> directive is used inside a <code>&lt;Limit&gt;</code>
117 section to explicitly specify which hosts and/or networks have access to the
118 commands or operations being limited. <code>Allow</code> is typically used in
119 conjunction with the <a href="#Order"><code>Order</code></a> and
120 <a href="#Deny"><code>Deny</code></a> directives in order to create
121 sophisticated access control rules.
122
123 <p>
124 <code>Allow</code> takes an optional first parameter: the keyword "from".
125 Using "from" is purely cosmetic. The remaining parameters are expected to be a
126 list of hosts and/or networks which will be explicitly granted access. The
127 keyword "all" can be used to indicate that <b>all</b> hosts will explicitly be
128 granted access; this "all" keyword is analogous to the
129 <a href="#AllowAll"><code>AllowAll</code></a> directive, except with a lower
130 priority. In addition, the keyword "none" can be used to indicate that
131 <b>no</b> hosts or networks will be explicitly granted access. Note, though,
132 that using "none" does <b>not</b> prevent the hosts/networks from being
133 <i>implicitly</i> granted access. If the "all" or "none" keywords are used,
134 no other hosts or networks can be supplied.
135
136 <p>
137 Host and network addresses can be specified by name <i>or</i> by numeric
138 address. For security reasons, it is recommended that all address information
139 be supplied using IP addresses. Relying solely on DNS names causes access
140 controls to depend heavily upon DNS servers which themselves may be vulnerable
141 to attack or spoofing. IP addresses which specify an entire network should
142 end in a trailing period (<i>i.e.</i> "10.0.0." for the entire 10.0.0 subnet).
143 DNS names which specify an entire network should begin with a leading period
144 (<i>i.e.</i> ".proftpd.org" for the entire proftpd.org domain).
145
146 <p>
147 Examples:
148 <pre>
149 &lt;Limit LOGIN&gt;
150 Order allow,deny
151 Allow from 128.44.26. 128.44.27. myhost.mydomain.edu .trusted-domain.org
152 Deny from all
153 &lt;/Limit&gt;
154 </pre>
155
156 <p>
157 See also: <a href="#Deny"><code>Deny</code></a>,
158 <a href="#Limit"><code>&lt;Limit&gt;</code></a>,
159 <a href="#Order"><code>Order</code></a><br>
160
161 <p>
162 <hr>
163 <h3><a name="AllowAll">AllowAllow</a></h3>
164 <strong>Syntax:</strong> AllowAll<br>
165 <strong>Default:</strong> None<br>
166 <strong>Context:</strong> <code>&lt;Anonymous&gt;</code>, <code>&lt;Limit&gt;</code>, <code>&lt;Directory&gt;</code>, .ftpaccess<br>
167 <strong>Module:</strong> mod_core<br>
168 <strong>Compatibility:</strong> 0.99.0 and later
169
170 <p>
171 The <code>AllowAll</code> directive <i>explicitly</i> allows access to its
172 parent <code>&lt;Anonymous&gt;</code>, <code>&lt;Limit&gt;</code>, or
173 <code>&lt;Directory&gt;</code> configuration section.
174
175 <p>
176 The default ProFTPD behavior is to <i>implicitly</i> allow access, which has a
177 low priority. The <code>AllowAll</code> directive creates an <em>explicit</em>
178 allow rule, overriding any higher level <code>Deny</code> directives.
179
180 <p>
181 See also: <a href="#DenyAll"><code>DenyAll</code></a>
182
183 <p>
184 <hr>
185 <h3><a name="AllowClass">AllowClass</a></h3>
186 <strong>Syntax:</strong> AllowClass <em>["AND"|"OR"|"regex"] expression</em><br>
187 <strong>Default:</strong> None<br>
188 <strong>Context:</strong> <code>&lt;Limit&gt;</code><br>
189 <strong>Module:</strong> mod_core<br>
190 <strong>Compatibility:</strong> 1.2.10rc1 and later
191
192 <p>
193 The <code>AllowClass</code> directive specifies an <em>expression</em> of
194 <a href="../howto/Classes.html">classes</a> that are permitted access within
195 the parent <code>&lt;Limit&gt;</code> configuration section. The
196 <em>expression</em> parameter has a similar syntax as that used in
197 <a href="#AllowGroup"><code>AllowGroup</code></a>, in that the parameter should
198 contain a comma delimited list of class names (or "not" class names, by
199 prefixing a class name with the <code>!</code> character) that are to be
200 allowed access in that configuration section.
201
202 <p>
203 By default, the <em>expression</em> is parsed as a Boolean "OR" list, meaning
204 that <b>any</b> elements of the <em>expression</em> must evaluate to logically
205 true in order for the explicit allow rule to apply, <i>e.g.</i> "this name
206 <b>or</b> that name <b>or</b> this other name...". In order to treat the
207 <em>expression</em> as a Boolean "AND" list, meaning that <b>all</b> of the
208 elements must evaluate to logically true (<i>e.g.</i> "this name <b>and</b> not that name..."), use the optional <em>AND</em> keyword. Similarly, to treat the
209 <em>expression</em> as a regular expression, use the <em>regex</em> keyword.
210
211 <p>
212 Examples:
213 <pre>
214 # An OR-evaluated AllowClass directive
215 AllowClass OR known,good,trusted
216
217 # An AND-evaluated AllowClass directive
218 AllowClass AND good,!scanner
219
220 # A regular expression AllowClass directive
221 AllowClass regex ^known
222 </pre>
223
224 <p>
225 See also: <a href="#AllowUser"><code>AllowUser</code></a>,
226 <a href="#AllowGroup"><code>AllowGroup</code></a>,
227 <a href="#DenyClass"><code>DenyClass</code></a>,
228 <a href="#DenyGroup"><code>DenyGroup</code></a>,
229 <a href="#DenyUser"><code>DenyUser</code></a>
230
231 <p>
232 <hr>
233 <h3><a name="AllowFilter">AllowFilter</a></h3>
234 <strong>Syntax:</strong> AllowFilter <em>pattern [flags]</em><br>
235 <strong>Default:</strong> None<br>
236 <strong>Context:</strong> server config, <code>&lt;VirtualHost&gt;</code>, <code>&lt;Global&gt;</code>, <code>&lt;Anonymous&gt;</code>, <code>&lt;Directory&gt;</code>, .ftpaccess<br>
237 <strong>Module:</strong> mod_core<br>
238 <strong>Compatibility:</strong> 1.2.0pre7 and later
239
240 <p>
241 The <code>AllowFilter</code> directive allows the configuration of a regular
242 expression <em>pattern</em> that must be matched for all command arguments sent
243 to ProFTPD. It is extremely useful in controlling what characters may be sent
244 in a command to ProFTPD, preventing some possible types of attacks against
245 ProFTPD.
246
247 <p>
248 The regular expression <em>pattern</em> is applied against the arguments to the
249 command sent by the client, so care must be taken when creating a proper regex.
250 Commands that fail the regex match result in a "Forbidden command" error being
251 returned to the client. If the <em>pattern</em> contains whitespace, it
252 <b>must</b> be enclosed in quotes.
253
254 <p>
255 The optional <em>flags</em> parameter, if present, modifies how the given
256 <em>pattern</em> will be evaludated. The supported flags are:
257 <ul>
258 <li><b>nocase|NC</b> (<b>n</b>o <b>c</b>ase)<br>
259 This makes the <em>pattern</em> case-insensitive, <i>i.e.</i> there is
260 no difference between 'A-Z' and 'a-z' when <em>pattern</em> is matched
261 against the path
262 </li>
263 </ul>
264
265 <p>
266 The example below allows commands which contain alphanumeric characters and
267 whitespace:
268 <pre>
269 AllowFilter "^[a-zA-Z0-9 ,]*$"
270 </pre>
271
272 <p>
273 The <a href="../howto/Filters.html">Filters</a> howto covers filtering in
274 greater detail.
275
276 <p>
277 See also: <a href="#DenyFilter"><code>DenyFilter</code></a>, <a href="#PathAllowFilter"><code>PathAllowFilter</code></a>, <a href="#PathDenyFilter"><code>PathDenyFilter</code></a>
278
279 <p>
280 <hr>
281 <h3><a name="AllowForeignAddress">AllowForeignAddress</a></h3>
282 <strong>Syntax:</strong> AllowForeignAddress <em>on|off|class-name</em><br>
283 <strong>Default:</strong> None<br>
284 <strong>Context:</strong> server config, <code>&lt;VirtualHost&gt;</code>, <code>&lt;Global&gt;</code>, <code>&lt;Anonymous&gt;</code><br>
285 <strong>Module:</strong> mod_core<br>
286 <strong>Compatibility:</strong> 1.1.7 and later
287
288 <p>
289 Normally, <code>proftpd</code> disallows clients from using the FTP
290 <code>PORT</code> or <code>EPRT</code> command with anything other than their
291 own IP address (<i>i.e.</i> the source IP address of the FTP control
292 connection), as well as preventing the use of <code>PORT</code> or
293 <code>EPRT</code> to specify a low-numbered (<i>i.e.</i> less than 1024) port
294 number. In either case, the client is sent an "Invalid port" response error
295 and a message is logged indicating either "address mismatch" or "bounce attack".
296
297 <p>
298 By enabling the <code>AllowForeignAddress</code> directive, <code>proftpd</code>
299 will allow clients to transmit foreign data connection addresses that do not
300 match the client's IP address. This allows such tricks as permitting a client
301 to transfer a file between two FTP servers without involving itself in the
302 actual data connection. However, allowing this functionality is generally
303 considered a bad idea, security-wise. The <code>AllowForeignAddress</code>
304 directive only affects FTP data connection addresses; not TCP ports. There is
305 no way (and no valid reason) to allow a client to use a low-numbered port in
306 its <code>PORT</code> or <code>EPRT</code> command.
307
308 <p>
309 In ProFTPD 1.3.7rc1 and later, the <code>AllowForeignAddress</code> directive
310 started supporting selectively allowing foreign address based on matching
311 the requested foreign address against a configured
312 <a href="../howto/Classes.html"><code>&lt;Class&gt;</code></a> name. Rather
313 than providing <em>on</em> or <em>off</em>, you can now provide the name of
314 a class; if the foreign address satisfies that class, the transfer is allowed:
315 <pre>
316 &lt;Class allowed-fxps&gt;
317 From 172.16.0.0/16
318 From *.example.com
319 &lt;/Class&gt;
320
321 # Allow site-to-site transfers for some sites
322 AllowForeignAddress allowed-fxps
323 </pre>
324
325 <p>
326 <hr>
327 <h3><a name="AllowGroup">AllowGroup</a></h3>
328 <strong>Syntax:</strong> AllowGroup <em>["AND"|"OR"|"regex"] expression</em><br>
329 <strong>Default:</strong> None<br>
330 <strong>Context:</strong> <code>&lt;Limit&gt;</code><br>
331 <strong>Module:</strong> mod_core<br>
332 <strong>Compatibility:</strong> 1.1.1 and later
333
334 <p>
335 The <code>AllowGroup</code> directive configures an <em>expression</em> that is
336 specifically <i>permitted</i> within the context of the containing
337 <code>&lt;Limit&gt;</code> section. The <em>expression</em> parameter should
338 contain a comma separated list of group names, or "not" groups (by prefixing a
339 group name with the <code>!</code> character), that are to be allowed access
340 to the section.
341
342 <p>
343 By default, the <em>expression</em> is evaluated as a Boolean <em>AND</em> list,
344 meaning that <b>all</b> elements of the expression must evaluate to logically
345 true (<i>i.e.</i> "this group <b>and</b> this group <b>and</b> that group...")
346 in order to the explicit allow rule to apply. To evaluate the
347 <em>expression</em> as a Boolean <em>OR</em> list, meaning that <b>any</b> of
348 the elements must evaluate to logically true (<i>i.e.</i> "this group <b>or</b>
349 this group <b>or</b> that group..."), use the optional <em>OR</em> keyword.
350 Similarly, to evalulate the <em>expression</em> as a regular expression, use
351 the <em>regex</em> keyword.
352
353 <p>
354 Examples:
355 <pre>
356 &lt;Limit LOGIN&gt;
357 # Allow logins from users in the the www OR doc groups
358 AllowGroup OR www,doc
359
360 # Allow logins from users in the ftp group and not in the admin group
361 AllowGroup AND ftp,!admin
362
363 # Deny logins from any group starting with "sys"
364 DenyGroup regex ^sys
365 &lt;/Limit&gt;
366 </pre>
367
368 <p>
369 See also: <a href="#AllowUser"><code>AllowUser</code></a>,
370 <a href="#DenyGroup"><code>DenyGroup</code></a>,
371 <a href="#DenyUser"><code>DenyUser</code></a>
372
373 <p>
374 <hr>
375 <h3><a name="AllowOverride">AllowOverride</a></h3>
376 <strong>Syntax:</strong> AllowOverride <em>on|off</em><br>
377 <strong>Default:</strong> None<br>
378 <strong>Context:</strong> server config, <code>&lt;VirtualHost&gt;</code>, <code>&lt;Global&gt;</code>, <code>&lt;Anonymous&gt;</code><br>
379 <strong>Module:</strong> mod_core<br>
380 <strong>Compatibility:</strong> 1.2.7rc1 and later
381
382 <p>
383 Normally, the <code>proftpd</code> server will look for, and parse, any files
384 named <code>.ftpaccess</code> in the encountered directories. These files
385 provide functionality similar to Apache's <code>.htaccess</code> files --
386 mini-configuration files. This <code>AllowOverride</code> directive controls
387 when/if these <code>.ftpaccess</code> files will be parsed.
388
389 <p>
390 <hr>
391 <h3><a name="AllowUser">AllowUser</a></h3>
392 <strong>Syntax:</strong> AllowUser <em>["AND"|"OR"|"regex"] expression</em><br>
393 <strong>Default:</strong> None<br>
394 <strong>Context:</strong> <code>&lt;Limit&gt;</code><br>
395 <strong>Module:</strong> mod_core<br>
396 <strong>Compatibility:</strong> 1.1.7 and later
397
398 <p>
399 The <code>AllowUser</code> directive configures an <em>expression</em> that is
400 specifically <i>permitted</i> within the context of the containing
401 <code>&lt;Limit&gt;</code> section. The <em>expression</em> parameter should
402 contain a comma separated list of user names, or "not" users (by prefixing a
403 user name with the <code>!</code> character), that are to be allowed access
404 to the section.
405
406 <p>
407 Now, <b>unlike</b> <code>AllowGroup</code>, the <code>AllowUser</code>
408 <em>expression</em> is evaluated as a Boolean <em>OR</em> list by default,
409 meaning that <b>any</b> elements of the expression must evaluate to logically
410 true (<i>i.e.</i> "this user <b>or</b> this user <b>or</b> that user...")
411 in order to the explicit allow rule to apply. To evaluate the
412 <em>expression</em> as a Boolean <em>AND</em> list, meaning that <b>all</b> of
413 the elements must evaluate to logically true (<i>i.e.</i> "this user <b>and</b>
414 this user <b>and</b> that user..."), use the optional <em>AND</em> keyword.
415 (Note that a single user <b>cannot</b> be "this user <b>and</b> that user" at
416 the same time, thus the value of <em>AND</em> lists for users is debatable.)
417 Similarly, to evalulate the <em>expression</em> as a regular expression, use
418 the <em>regex</em> keyword.
419
420 <p>
421 Examples:
422 <pre>
423 &lt;Limit RETR&gt;
424 # Allow these users to download
425 AllowUser OR alice,bob,chuck
426
427 # Or these users, based on our regex
428 AllowUser regex ^ftp_
429 &lt;/Limit&gt;
430 </pre>
431
432 <p>
433 See also: <a href="#AllowGroup"><code>AllowGroup</code></a>,
434 <a href="#DenyGroup"><code>DenyGroup</code></a>,
435 <a href="#DenyUser"><code>DenyUser</code></a>
436
437 <p>
438 <hr>
439 <h3><a name="Anonymous">&lt;Anonymous&gt;</a></h3>
440 <strong>Syntax:</strong> &lt;Anonymous <em>anon-directory</em>&gt;<br>
441 <strong>Default:</strong> None<br>
442 <strong>Context:</strong> server config, <code>&lt;VirtualHost&gt;</code>, <code>&lt;Global&gt;</code><br>
443 <strong>Module:</strong> mod_core<br>
444 <strong>Compatibility:</strong> 0.99.0 and later
445
446 <p>
447 The <code>&lt;Anonymous&gt;</code> configuration section is used to create an
448 anonymous FTP login, and is closed by a matching &lt;/Anonymous&gt; directive.
449 The <em>anon-directory</em> parameter specifies the directory to which the
450 daemon, immediately after successful authentication, will restrict the session
451 via <code>chroot(2)</code>.
452
453 <p>
454 Once the <code>chroot(2)</code> successfully completes, higher level
455 directories are no longer accessible to that session process (and thus to the
456 logged in user). By default, ProFTPD <i>assumes</i> an anonymous login
457 <i>if</i> the remote client attempts to authenticate as the currently running
458 <code>User</code> for that server. Unless the current user is &quot;root&quot;,
459 in which case anonymous logins are <b>not</b> allowed regardless of the
460 presence of an <code>&lt;Anonymous&gt;</code> section. To force anonymous
461 logins to be bound to a user other than the current user, see the
462 <a href="#User"><code>User</code></a> and
463 <a href="#Group"><code>Group</code></a> directives. In addition, if a
464 <code>User</code> or <code>Group</code> directive <i>is</i> present in an
465 <code>&lt;Anonymous&gt;</code> section, ProFTPD permanently switches to that
466 UID/GID before the <code>chroot(2)</code>.
467
468 <p>
469 Normally, anonymous logins are <b>not</b> required to authenticate with a
470 password, but <b>are</b> expected to enter a valid email address in place of a
471 normal password; this email address is logged. If this behavior is undesirable
472 for a given <code>&lt;Anonymous&gt;</code> configuration section, it can be
473 overridden via the
474 <a href="mod_auth.html#AnonRequirePassword"><code>AnonRequirePassword</code></a>
475 directive.
476
477 <p>
478 The following is an example of a typical anonymous FTP configuration:
479 <pre>
480 &lt;Anonymous /home/ftp&gt;
481 # After anonymous login, daemon runs as user/group ftp.
482 User ftp
483 Group ftp
484
485 # The client login 'anonymous' is aliased to the "real" user 'ftp'.
486 UserAlias anonymous ftp
487
488 # Deny write operations to all directories, except for 'incoming' where
489 # STOR is allowed (but READ operations are prohibited).
490 &lt;Directory *&gt;
491 &lt;Limit WRITE&gt;
492 DenyAll
493 &lt;/Limit&gt;
494 &lt;/Directory&gt;
495
496 &lt;Directory incoming&gt;
497 &lt;Limit READ&gt;
498 DenyAll
499 &lt;/Limit&gt;
500
501 &lt;Limit STOR&gt;
502 AllowAll
503 &lt;/Limit&gt;
504 &lt;/Directory&gt;
505 &lt;/Anonymous&gt;
506 </pre>
507
508 <p>
509 <hr>
510 <h3><a name="AuthOrder">AuthOrder</a></h3>
511 <strong>Syntax:</strong> AuthOrder <em>module-name1 ...</em><br>
512 <strong>Default:</strong> mod_auth_file.c mod_auth_unix.c<br>
513 <strong>Context:</strong> server config, <code>&lt;VirtualHost&gt;</code>, <code>&lt;Global&gt;</code><br>
514 <strong>Module:</strong> mod_core<br>
515 <strong>Compatibility:</strong> 1.2.8rc1 and later
516
517 <p>
518 The <code>AuthOrder</code> directive configures the names of auth modules, and
519 the order in which they will be checked when authenticating a client.
520
521 <p>
522 At least one module name <b>must</b> be given; there is no maximum number of
523 modules that can be listed. The listed module names must the full name of the
524 source file, <i>e.g.</i> "mod_auth_unix.c". To see a full list of module names,
525 use:
526 <pre>
527 $ proftpd -l
528 </pre>
529 Do <b>not</b> use "mod_auth.c", as that module is the authentication front end
530 module, and is necessary. Also, do not use "mod_auth_pam.c" as the only module,
531 as that module does not provide, by itself, all of the information needed
532 by proftpd for authenticating a client.
533
534 <p>
535 You can make an auth module be "authoritative" by appending an asterisk (*)
536 after the module name. Usually this is done for the "mod_auth_pam.c" module,
537 to ensure that the login fails if the PAM check fails.
538
539 <p>
540 <b>Examples</b>
541 <pre>
542 # Use only AuthUserFiles when authenticating, and not the system's /etc/passwd
543 AuthOrder mod_auth_file.c
544
545 # If the user's information is not in LDAP, they're not a user to use
546 # this server.
547 AuthOrder mod_ldap.c
548
549 # Use SQL tables first, then LDAP, for authentication
550 AuthOrder mod_sql.c mod_ldap.c
551
552 # Use the normal system /etc/passwd and PAM, but make sure that PAM is
553 # authoritative about accepting or rejecting the login
554 AuthOrder mod_auth_pam.c* mod_auth_unix.c
555 </pre>
556
557 <p>
558 <hr>
559 <h3><a name="Class">&lt;Class&gt;</a></h3>
560 <strong>Syntax:</strong> &lt;Class <em>name</em>&gt;<br>
561 <strong>Default:</strong> None<br>
562 <strong>Context:</strong> server config, <code>&lt;Global&gt;</code><br>
563 <strong>Module:</strong> mod_core<br>
564 <strong>Compatibility:</strong> 1.2.10rc1 and later
565
566 <p>
567 The <code>&lt;Class&gt;</code> and <code>&lt;/Class&gt;</code> encompass
568 a section which defines and <em>names</em> a connection <em>class</em>.
569
570 <p>
571 Example:
572 <pre>
573 &lt;Class LAN&gt;
574 From 192.168.0.0/16
575 &lt;/Class>
576 </pre>
577 These connection classes are covered in much greater detail in the
578 <a href="../howto/Classes.html">Classes</a> howto.
579
580 <p>
581 <hr>
582 <h3><a name="CommandBufferSize">CommandBufferSize</a></h3>
583 <strong>Syntax:</strong> CommandBufferSize <em>size</em><br>
584 <strong>Default:</strong> CommandBufferSize 512<br>
585 <strong>Context:</strong> server config, <code>&lt;VirtualHost&gt;</code>, <code>&lt;Global&gt;</code><br>
586 <strong>Module:</strong> mod_core<br>
587 <strong>Compatibility:</strong> 1.2.0pre7 and later
588
589 <p>
590 The <code>CommandBufferSize</code> directive controls the maximum command
591 <em>size</em> (in bytes) permitted to be sent to the server. This allows you
592 to effectively control the longest command the server may accept, and can help
593 protect the server from various Denial of Service or resource-consumption
594 attacks.
595
596 <p>
597 <hr>
598 <h3><a name="DebugLevel">DebugLevel</a></h3>
599 <strong>Syntax:</strong> DebugLevel <em>level</em><br>
600 <strong>Default:</strong> DebugLevel 0<br>
601 <strong>Context:</strong> server config, <code>&lt;VirtualHost&gt;</code>, <code>&lt;Global&gt;</code><br>
602 <strong>Module:</strong> mod_core<br>
603 <strong>Compatibility:</strong> 1.2.8rc1 and later
604
605 <p>
606 The <code>DebugLevel</code> directive configures the debugging level the
607 server will use when logging. The <em>level</em> parameter must be between 0
608 and 10. This directive will take precedence over any
609 <code>-d</code>/<code>--debug</code> command-line debugging option used.
610
611 <p>
612 The <a href="../howto/Logging.html#Syslog">Logging</a> howto covers logging in
613 greater detail.
614
615 <p>
616 <hr>
617 <h3><a name="DefaultAddress">DefaultAddress</a></h3>
618 <strong>Syntax:</strong> DefaultAddress <em>ip-address|dns-name</em> <em>[ip-address|dns-name ...]</em><br>
619 <strong>Default:</strong> None<br>
620 <strong>Context:</strong> server config<br>
621 <strong>Module:</strong> mod_core<br>
622 <strong>Compatibility:</strong> 1.2.7rc1 and later
623
624 <p>
625 The <code>DefaultAddress</code> directive sets the the address to which the
626 main server instance (<i>i.e.</i> the server configured by the "server config"
627 context) will bind. The default behaviour is to select whatever IP address
628 is reported by the operating system as the primary IP address.
629
630 <p>
631 Starting with <code>proftpd-1.3.0rc1</code>, it is possible to use more than
632 one FQDN or IP address.
633
634 <p>
635 Examples
636 <pre>
637 ServerName "Default FTP Server"
638 Port 21
639
640 # We want the main server instance to listen on a specific IP
641 DefaultAddress 192.168.10.30
642
643 # Since 1.3.0rc1 it's also possible to use the following:
644 DefaultAddress 192.168.10.30 my.domain.tld
645 </pre>
646
647 <p>
648 In <code>proftpd-1.3.5rc1</code>, the <code>DefaultAddress</code> directive
649 also handles names which indicates the <em>device-name</em> (or
650 <em>interface-name</em>); the IP address associated with this device/interface
651 will be used. For example, you can use:
652 <pre>
653 DefaultAddress eth0
654 </pre>
655 Using the device/interface name is useful in cases where the same
656 <code>proftpd.conf</code> file is going to be deployed to multiple different
657 machines, which will have the same device/interface names but different IP
658 addresses.
659
660 <p>
661 See also: <a href="#VirtualHost"><code>&lt;VirtualHost&gt;</code></a>
662
663 <p>
664 <hr>
665 <h3><a name="DefaultServer">DefaultServer</a></h3>
666 <strong>Syntax:</strong> DefaultServer <em>on|off</em><br>
667 <strong>Default:</strong> None<br>
668 <strong>Context:</strong> server config, <code>&lt;VirtualHost&gt;</code><br>
669 <strong>Module:</strong> mod_core<br>
670 <strong>Compatibility:</strong> 0.99.0 and later
671
672 <p>
673 The <code>DefaultServer</code> directive controls which server configuration is
674 used as the fallback when a matching vhost cannot be found for an incoming
675 connection.
676
677 <p>
678 Normally, if the incoming connection is destined for an IP address which is
679 neither the host's primary IP address nor one of the addresses specified in a
680 <code>&lt;VirtualHost&gt;</code> configuration section, the "unknown"
681 connection receives the following response:
682 <pre>
683 500 Sorry, no server available to handle request on <i>a.b.c.d</i>
684 </pre>
685 and is disconnected. When <code>DefaultServer</code> is enabled for either
686 the primary server configuration <i>or</i> a virtual server, these "unknown"
687 connections are handled by that configuration.
688
689 <p>
690 Only a single server configuration can be set as the <code>DefaultServer</code>.
691
692 <p>
693 <hr>
694 <h3><a name="Define">Define</a></h3>
695 <strong>Syntax:</strong> Define <em>label</em><br>
696 <strong>Default:</strong> None<br>
697 <strong>Context:</strong> <em>any</em><br>
698 <strong>Module:</strong> mod_core<br>
699 <strong>Compatibility:</strong> 1.2.6rc1 and later
700
701 <p>
702 The <code>Define</code> directive <em>defines</em> a label, and is used
703 in conjunction with <a href="#IfDefine"><code>&lt;IfDefine&gt;</code></a> to
704 provide <i>conditional</i> configuration sections. This directive is the
705 configuration file equivalent of the <code>-D</code> command-line option.
706
707 <p>
708 Example:
709 <pre>
710 # Define ANONYMOUS (or comment this out), for anonymous login support
711 Define ANONYMOUS
712
713 # If the label ANONYMOUS is defined, use this &lt;Anonymous&gt; section
714 &lt;IfDefine ANONYMOUS&gt;
715 &lt;Anonymous ~ftp&gt;
716 ...
717 &lt;/Anonymous&gt;
718 &lt;/IfDefine&gt;
719 </pre>
720
721 <p>
722 <hr>
723 <h3><a name="Deny">Deny</a></h3>
724 <strong>Syntax:</strong> Deny <em>[from] "all"|"none"|host|network...</em><br>
725 <strong>Default:</strong> None<br>
726 <strong>Context:</strong> <code>&lt;Limit&gt;</code><br>
727 <strong>Module:</strong> mod_core<br>
728 <strong>Compatibility:</strong> 0.99.0p16 and later
729
730 <p>
731 The <code>Deny</code> directive is used to create a list of hosts and/or
732 networks which will explicitly be denied access to a given
733 <code>&lt;Limit&gt;</code> section. The keywords "all" and "none" can be used
734 to indicate that <b>all</b> hosts are denied access, or that <b>no</b> hosts
735 are explicitly denied, respectively. For more information on the syntax and
736 usage of the <code>Deny</code> directive, see the
737 <a href="#Allow"><code>Allow</code></a> description.
738
739 <p>
740 Examples:
741 <pre>
742 &lt;Limit LOGIN&gt;
743 Order deny,allow
744 Deny from 128.44.26.,128.44.27.,.evil-domain.com
745 Allow from all
746 &lt;/Limit&gt;
747 </pre>
748
749 <p>
750 See also: <a href="#Allow"><code>Allow</code></a>,
751 <a href="#Limit"><code>&lt;Limit&gt;</code></a>,
752 <a href="#Order"><code>Order</code></a>
753
754 <p>
755 <hr>
756 <h3><a name="DenyAll">DenyAll</a></h3>
757 <strong>Syntax:</strong> DenyAll<br>
758 <strong>Default:</strong> None<br>
759 <strong>Context:</strong> <code>&lt;Anonymous&gt;</code>, <code>&lt;Limit&gt;</code>, <code>&lt;Directory&gt;</code>, .ftpaccess<br>
760 <strong>Module:</strong> mod_core<br>
761 <strong>Compatibility:</strong> 0.99.0 and later
762
763 <p>
764 The <code>DenyAll</code> directive <i>explicitly</i> denies access to its
765 parent <code>&lt;Anonymous&gt;</code>, <code>&lt;Limit&gt;</code>, or
766 <code>&lt;Directory&gt;</code> configuration section.
767
768 <p>
769 The default ProFTPD behavior is to <i>implicitly</i> allow access, which has a
770 low priority. The <code>DenyAll</code> directive creates an <em>explicit</em>
771 deny rule, overriding any higher level <code>Allow</code> directives.
772
773 <p>
774 See also: <a href="#AllowAll"><code>AllowAll</code></a>
775
776 <p>
777 <hr>
778 <h3><a name="DenyClass">DenyClass</a></h3>
779 <strong>Syntax:</strong> DenyClass <em>["AND"|"OR"|"regex"] expression</em><br>
780 <strong>Default:</strong> None<br>
781 <strong>Context:</strong> <code>&lt;Limit&gt;</code><br>
782 <strong>Module:</strong> mod_core<br>
783 <strong>Compatibility:</strong> 1.2.10rc1 and later
784
785 <p>
786 The <code>DenyClass</code> directive specifies an <em>expression</em> of
787 <a href="../howto/Classes.html">classes</a> that are <b>denied</b> access within
788 the parent <code>&lt;Limit&gt;</code> configuration section. The
789 <em>expression</em> parameter has a similar syntax as that used in
790 <a href="#AllowGroup"><code>AllowGroup</code></a>, in that the parameter should
791 contain a comma delimited list of class names (or "not" class names, by
792 prefixing a class name with the <code>!</code> character) that are to be
793 denied access in that configuration section.
794
795 <p>
796 By default, the <em>expression</em> is parsed as a Boolean "OR" list, meaning
797 that <b>any</b> elements of the <em>expression</em> must evaluate to logically
798 true in order for the explicit deny rule to apply, <i>e.g.</i> "this name
799 <b>or</b> that name <b>or</b> this other name...". In order to treat the
800 <em>expression</em> as a Boolean "AND" list, meaning that <b>all</b> of the
801 elements must evaluate to logically true (<i>e.g.</i> "this name <b>and</b> not that name..."), use the optional <em>AND</em> keyword. Similarly, to treat the
802 <em>expression</em> as a regular expression, use the <em>regex</em> keyword.
803
804 <p>
805 Examples:
806 <pre>
807 # An OR-evaluated DenyClass directive
808 DenyClass OR bad,scanner,spammer
809
810 # An AND-evaluated DenyClass directive
811 DenyClass AND bad,!known
812
813 # A regular expression DenyClass directive
814 DenyClass regex ^spam
815 </pre>
816
817 <p>
818 See also: <a href="#AllowUser"><code>AllowUser</code></a>,
819 <a href="#AllowClass"><code>AllowClass</code></a>,
820 <a href="#AllowGroup"><code>AllowGroup</code></a>,
821 <a href="#DenyGroup"><code>DenyGroup</code></a>,
822 <a href="#DenyUser"><code>DenyUser</code></a>
823
824 <p>
825 <hr>
826 <h3><a name="DenyFilter">DenyFilter</a></h3>
827 <strong>Syntax:</strong> DenyFilter <em>pattern [flags]</em><br>
828 <strong>Default:</strong> None<br>
829 <strong>Context:</strong> server config, <code>&lt;VirtualHost&gt;</code>, <code>&lt;Global&gt;</code>, <code>&lt;Anonymous&gt;</code>,<code>&lt;Directory&gt;</code>, .ftpaccess<br>
830 <strong>Module:</strong> mod_core<br>
831 <strong>Compatibility:</strong> 1.2.0pre7 and later
832
833 <p>
834 The <code>DenyFilter</code> directive, like the
835 <a href="AllowFilter"><code>AllowFilter</code></a> directive, specifies a
836 regular expression <em>pattern</em> which must not match any of the command
837 arguments. If the <em>pattern</em> does match, a "Forbidden command" error is
838 returned to the client. This can be especially useful for forbidding certain
839 command parameter combinations from ever reaching ProFTPD.
840
841 <p>
842 Note that the <code>PASV</code> SFTP command <b>cannot</b> be blocked using
843 this directive.
844
845 <p>
846 The optional <em>flags</em> parameter, if present, modifies how the given
847 <em>pattern</em> will be evaludated. The supported flags are:
848 <ul>
849 <li><b>nocase|NC</b> (<b>n</b>o <b>c</b>ase)<br>
850 This makes the <em>pattern</em> case-insensitive, <i>i.e.</i> there is
851 no difference between 'A-Z' and 'a-z' when <em>pattern</em> is matched
852 against the path
853 </li>
854 </ul>
855
856 <p>
857 For example, to reject commands which contain the percent (<code>%</code>)
858 character, you could use:
859 <pre>
860 DenyFilter "%"
861 </pre>
862
863 <p>
864 The <a href="../howto/Filters.html">Filters</a> howto covers filtering in
865 greater detail.
866
867 <p>
868 See also: <a href="#AllowFilter"><code>AllowFilter</code></a>,
869 <a href="#PathAllowFilter"><code>PathAllowFilter</code></a>,
870 <a href="#PathDenyFilter"><code>PathDenyFilter</code></a>
871
872 <p>
873 <hr>
874 <h3><a name="DenyGroup">DenyGroup</a></h3>
875 <strong>Syntax:</strong> DenyGroup <em>["AND"|"OR"|"regex"] expression</em><br>
876 <strong>Default:</strong> None<br>
877 <strong>Context:</strong> <code>&lt;Limit&gt;</code><br>
878 <strong>Module:</strong> mod_core<br>
879 <strong>Compatibility:</strong> 1.1.1 and later
880
881 <p>
882 The <code>DenyGroup</code> directive configures an <em>expression</em> that is
883 specifically <i>permitted</i> within the context of the containing
884 <code>&lt;Limit&gt;</code> section. The <em>expression</em> parameter should
885 contain a comma separated list of group names, or "not" groups (by prefixing a
886 group name with the <code>!</code> character), that are to be denied access
887 to the section.
888
889 <p>
890 By default, the <em>expression</em> is evaluated as a Boolean <em>AND</em> list,
891 meaning that <b>all</b> elements of the expression must evaluate to logically
892 true (<i>i.e.</i> "this group <b>and</b> this group <b>and</b> that group...")
893 in order to the explicit deny rule to apply. To evaluate the
894 <em>expression</em> as a Boolean <em>OR</em> list, meaning that <b>any</b> of
895 the elements must evaluate to logically true (<i>i.e.</i> "this group <b>or</b>
896 this group <b>or</b> that group..."), use the optional <em>OR</em> keyword.
897 Similarly, to evalulate the <em>expression</em> as a regular expression, use
898 the <em>regex</em> keyword.
899
900 <p>
901 Examples:
902 <pre>
903 &lt;Limit LOGIN&gt;
904 # Deny logins from users in the the www OR doc groups
905 DenyGroup OR www,doc
906
907 # Deny logins from users in the ftp group and not in the admin group
908 DenyGroup AND ftp,!admin
909
910 # Allow logins from any group starting with "sys"
911 AllowGroup regex ^sys
912 &lt;/Limit&gt;
913 </pre>
914
915 <p>
916 See also: <a href="#AllowGroup"><code>AllowGroup</code></a>,
917 <a href="#AllowUser"><code>AllowUser</code></a>,
918 <a href="#DenyUser"><code>DenyUser</code></a>
919
920 <p>
921 <hr>
922 <h3><a name="DenyUser">DenyUser</a></h3>
923 <strong>Syntax:</strong> DenyUser <em>["AND"|"OR"|"regex"] expression</em><br>
924 <strong>Default:</strong> None<br>
925 <strong>Context:</strong> <code>&lt;Limit&gt;</code><br>
926 <strong>Module:</strong> mod_core<br>
927 <strong>Compatibility:</strong> 1.1.7 and later
928
929 <p>
930 The <code>DenyUser</code> directive configures an <em>expression</em> that is
931 specifically <i>denied</i> within the context of the containing
932 <code>&lt;Limit&gt;</code> section. The <em>expression</em> parameter should
933 contain a comma separated list of user names, or "not" users (by prefixing a
934 user name with the <code>!</code> character), that are to be denied access
935 to the section.
936
937 <p>
938 Now, <b>unlike</b> <code>AllowGroup</code>, the <code>DenyUser</code>
939 <em>expression</em> is evaluated as a Boolean <em>OR</em> list by default,
940 meaning that <b>any</b> elements of the expression must evaluate to logically
941 true (<i>i.e.</i> "this user <b>or</b> this user <b>or</b> that user...")
942 in order to the explicit deny rule to apply. To evaluate the
943 <em>expression</em> as a Boolean <em>AND</em> list, meaning that <b>all</b> of
944 the elements must evaluate to logically true (<i>i.e.</i> "this user <b>and</b>
945 this user <b>and</b> that user..."), use the optional <em>AND</em> keyword.
946 (Note that a single user <b>cannot</b> be "this user <b>and</b> that user" at
947 the same time, thus the value of <em>AND</em> lists for users is debatable.)
948 Similarly, to evalulate the <em>expression</em> as a regular expression, use
949 the <em>regex</em> keyword.
950
951 <p>
952 Examples:
953 <pre>
954 &lt;Limit RETR&gt;
955 # Deny to these users downloading
956 DenyUser OR alice,bob,chuck
957
958 # Or these users, based on our regex
959 DenyUser regex ^ftp_
960 &lt;/Limit&gt;
961 </pre>
962
963 <p>
964 See also: <a href="#AllowGroup"><code>AllowGroup</code></a>,
965 <a href="#AllowUser"><code>AllowUser</code></a>,
966 <a href="#DenyGroup"><code>DenyGroup</code></a>
967
968 <p>
969 <hr>
970 <h3><a name="Directory">&lt;Directory&gt;</a></h3>
971 <strong>Syntax:</strong> &lt;Directory <em>path</em>&gt;<br>
972 <strong>Default:</strong> None<br>
973 <strong>Context:</strong> server config, <code>&lt;VirtualHost&gt;</code>, <code>&lt;Global&gt;</code>, <code>&lt;Anonymous&gt;</code><br>
974 <strong>Module:</strong> mod_core<br>
975 <strong>Compatibility:</strong> 0.99.0 and later
976
977 <p>
978 The <code>&lt;Directory&gt;</code> section creates a set of configuration
979 directives which applies only to the specified directory <i>and</i> its
980 sub-directories. The section is ended with a matching
981 <code>&lt;/Directory&gt;</code>. Per-directory configuration is implemented
982 with a "closest" match algorithm, meaning that the
983 <code>&lt;Directory&gt;</code> section with the closest matching path to the
984 actual path of the file/directory in question is used. Per-directory
985 configuration is inherited by all sub-directories until a closer matching
986 <code>&lt;Directory&gt;</code> is found.
987
988 <p>
989 A trailing slash and wildcard (&quot;<code>/*</code>&quot;) can be appended to
990 the <em>path</em>, specifying that the configuration section applies <b>only</b>
991 to the contents (and sub-contents), <b>not</b> to the actual directory itself.
992 Such wildcard matches always take precedence over non-wildcard
993 <code>&lt;Directory&gt;</code> configuration sections.
994 <code>&lt;Directory&gt;</code> sections <b>cannot</b> be nested; they are
995 automatically nested at runtime based on their <em>paths</em>. <em>Paths</em>
996 must always be absolute (except inside <code>&lt;Anonymous&gt;</code> sections),
997 and should not reference symbolic links. Path inside of an
998 <code>&lt;Anonymous&gt;</code> section <i>may</i> be relative, indicating that
999 they are based on the <code>&lt;Anonymous&gt;</code> root directory.
1000
1001 <p>
1002 As of <code>proftpd-1.1.3</code> and later, <code>&lt;Directory&gt;</code> paths
1003 that begin with the special character <code>~</code>, and which do not specify
1004 a username immediately after the <code>~</code> character, are put into a
1005 special <em>deferred</em> mode. When <em>deferred</em> mode, the
1006 <code>&lt;Directory&gt;</code> section is not merged into the overall server
1007 configuration at startup time, but instead the merge is <em>deferred</em> until
1008 the client has authentication, at which time the <code>~</code> character is
1009 replaced with that authenticated user's home directory. This allows for a
1010 <code>&lt;Directory&gt;</code> section which applies to <i>all</i> users' home
1011 directories. This feature is not supported within an
1012 <code>&lt;Anonymous&gt;</code> section, however.
1013
1014 <p>
1015 Some examples:
1016 <pre>
1017 &lt;Directory /users/robroy/private&gt;
1018 HideNoAccess on
1019 &lt;/Directory&gt;
1020
1021 &lt;Directory ~/anonftp&gt;
1022 &lt;Limit WRITE&gt;
1023 DenyAll
1024 &lt;/Limit&gt;
1025 &lt;/Directory&gt;
1026 </pre>
1027
1028 <p>
1029 More information on using <code>&lt;Directory&gt;</code> sections, including
1030 examples, can be found in the
1031 <a href="../howto/Directory.html"><code>&lt;Directory&gt;</code> howto</a>.
1032
1033 <hr>
1034 <h3><a name="DisplayChdir">DisplayChdir</a></h3>
1035 <strong>Syntax:</strong> DisplayChdir <em>filename ["on"|"off"]</em><br>
1036 <strong>Default:</strong> None<br>
1037 <strong>Context:</strong> server config, <code>&lt;VirtualHost&gt;</code>, <code>&lt;Global&gt;</code>, <code>&lt;Anonymous&gt;</code>, <code>&lt;Directory&gt;</code><br>
1038 <strong>Module:</strong> mod_core<br>
1039 <strong>Compatibility:</strong> 1.3.1rc1 and later
1040
1041 <p>
1042 The <code>DisplayChdir</code> directive configures the name of a text file that
1043 will be displayed to the user, every time they change into a directory. If the
1044 text file should only be displayed <b>once</b> to the client, the first time
1045 they change into the directory (or if <code>proftpd</code> detects that the
1046 <code>DisplayChdir</code> file has been changed since it was last displayed
1047 to the client), then set the optional second parameter to <em>on</em> or
1048 <em>true</em>.
1049
1050 <p>
1051 If the <em>filename</em> is relative, it is looked for in the directory that
1052 the user has changed into. If <em>filename</em> cannot be found or accessed,
1053 no error occurs and nothing is displayed to the client.
1054
1055 <p>
1056 See the <a href="../howto/DisplayFiles.html">Display files</a> howto for
1057 more information on the variables that can be used in a
1058 <code>DisplayChdir</code> file.
1059
1060 <p>
1061 See also: <a href="#DisplayConnect"><code>DisplayConnect</code></a>, <a href="#DisplayQuit"><code>DisplayQuit</code></a>
1062
1063 <hr>
1064 <h3><a name="DisplayConnect">DisplayConnect</a></h3>
1065 <strong>Syntax:</strong> DisplayConnect <em>filename</em><br>
1066 <strong>Default:</strong> None<br>
1067 <strong>Context:</strong> server config, <code>&lt;VirtualHost&gt;</code>, <code>&lt;Global&gt;</code><br>
1068 <strong>Module:</strong> mod_core<br>
1069 <strong>Compatibility:</strong> 1.2.0pre2 and later
1070
1071 <p>
1072 The <code>DisplayConnect</code> directive configures the <em>filename</em> of a
1073 text file that will be displayed to the user when they initially connect,
1074 <i>before</i> they login. The <em>filename</em> can be either relative or
1075 absolute. In the case of a relative filename, the file is searched for
1076 starting in the home directory of the <code>User</code> as which the server is
1077 running. As this can lead to confusion, absolute pathnames are <i>highly
1078 recommended</i>. If <em>filename</em> cannot be found or accessed, no error
1079 occurs and nothing is logged or displayed to the client.
1080
1081 <p>
1082 See the <a href="../howto/DisplayFiles.html">Display files</a> howto for
1083 more information on the variables that can be used in a
1084 <code>DisplayConnect</code> file.
1085
1086 <p>
1087 See also: <a href="#DisplayChdir"><code>DisplayChdir</code></a>,
1088 <a href="#DisplayQuit"><code>DisplayQuit</code></a>
1089
1090 <hr>
1091 <h3><a name="DisplayQuit">DisplayQuit</a></h3>
1092 <strong>Syntax:</strong> DisplayQuit <em>filename</em><br>
1093 <strong>Default:</strong> None<br>
1094 <strong>Context:</strong> server config, <code>&lt;VirtualHost&gt;</code>, <code>&lt;Global&gt;</code>, <code>&lt;Anonymous&gt;</code><br>
1095 <strong>Module:</strong> mod_core<br>
1096 <strong>Compatibility:</strong> 1.2.0pre8 and later
1097
1098 <p>
1099 The <code>DisplayQuit</code> directive configures the <em>filename</em> of a
1100 text file that will be displayed to the user when they explicitly end the
1101 FTP session using the <code>QUIT</code> command. The <em>filename</em> can be
1102 either relative or absolute. In the case of a relative filename, the file is
1103 searched for starting in the home directory of the logged-in user. <b>Note</b>:
1104 if the session is restricted via <code>chroot</code>, either by the
1105 <code>DefaultRoot</code> directive or because its an
1106 <code>&lt;Anonymous&gt;</code> login, then <em>filename</em> must reside
1107 within the <code>chroot()</code> directory. As this can lead to confusion,
1108 absolute pathnames are <i>highly recommended</i>. If <em>filename</em> cannot
1109 be found or accessed, no error occurs and nothing is logged or displayed to
1110 the client.
1111
1112 <p>
1113 See the <a href="../howto/DisplayFiles.html">Display files</a> howto for
1114 more information on the variables that can be used in a
1115 <code>DisplayQuit</code> file.
1116
1117 <p>
1118 See also: <a href="#DisplayChdir"><code>DisplayChdir</code></a>,
1119 <a href="#DisplayConnect"><code>DisplayConnect</code></a>
1120
1121 <hr>
1122 <h3><a name="FSCachePolicy">FSCachePolicy</a></h3>
1123 <strong>Syntax:</strong> FSCachePolicy <em>on|off|size count [maxAge secs]</em><br>
1124 <strong>Default:</strong> FSCachePolicy off<br>
1125 <strong>Context:</strong> server config, <code>&lt;VirtualHost&gt;</code>, <code>&lt;Global&gt;</code><br>
1126 <strong>Module:</strong> mod_core<br>
1127 <strong>Compatibility:</strong> 1.3.6rc1 and later
1128
1129 <p>
1130 The <code>FSCachePolicy</code> directive configures the internal
1131 filesystem-related cache, used for performance optimizations on <i>e.g.</i>
1132 network filesystems. This directive can be used to disable this internal
1133 cache, or to tune the caching policy.
1134
1135 <p>
1136 To disable the cache altogether, use:
1137 <pre>
1138 FSCachePolicy off
1139 </pre>
1140
1141 <p>
1142 To configure the maximum number of entries in the cache before eviction happens:
1143 <pre>
1144 FSCachePolicy size 64
1145 </pre>
1146
1147 <p>
1148 To configure the maximum age (in seconds) of a cached entry before it is
1149 evicted:
1150 <pre>
1151 FSCachePolicy maxAge 60
1152 </pre>
1153
1154 <p>
1155 The <em>size</em> and <em>maxAge</em> parameters can be combined/set in the
1156 same directive, <i>e.g.</i>:
1157 <pre>
1158 # Set the maximum cache size at 128, and the max age at 120 seconds
1159 FSCachePolicy size 128 maxAge 120
1160 </pre>
1161
1162 <p>
1163 The default maximum number of entries is 3000, and the default maximum age is 3
1164 seconds. To enable use of these defaults, enable the cache using:
1165 <pre>
1166 FSCachePolicy on
1167 </pre>
1168
1169 <hr>
1170 <h3><a name="FSOptions">FSOptions</a></h3>
1171 <strong>Syntax:</strong> FSOptions <em>opt1 ...</em><br>
1172 <strong>Default:</strong> None<br>
1173 <strong>Context:</strong> server config, <code>&lt;VirtualHost&gt;</code>, <code>&lt;Global&gt;</code><br>
1174 <strong>Module:</strong> mod_core<br>
1175 <strong>Compatibility:</strong> 1.3.6rc3 and later
1176
1177 <p>
1178 The <code>FSOptions</code> directive configures various optional behavior of
1179 ProFTPD's filesystem API. The currently supported options are:
1180 <ul>
1181 <li><code>IgnoreExtendedAttributes</code>
1182 <p>
1183 When the <code>--enable-xattr</code> configure option is enabled, ProFTPD
1184 will support <a href="https://en.wikipedia.org/wiki/Extended_file_attributes"><em>extended attributes</em></a> where possible. However, this might cause
1185 issues with some clients (<i>e.g.</i> some SFTP clients) that do not
1186 properly support them. Use this option to disable ProFTPD's support for
1187 extended attributes.
1188 </li>
1189 </ul>
1190
1191 <hr>
1192 <h3><a name="Global">Global</a></h3>
1193 <strong>Syntax:</strong> &lt;Global&gt;<br>
1194 <strong>Default:</strong> None<br>
1195 <strong>Context:</strong> server config, <code>&lt;VirtualHost&gt;</code><br>
1196 <strong>Module:</strong> mod_core<br>
1197 <strong>Compatibility:</strong> 1.16 and later
1198
1199 <p>
1200 The <code>&lt;Global&gt;</code> section is used to create a set of
1201 configuration directives; this set is then applied universally to both the main
1202 server configuration <i>and</i> <b>all</b> <code>&lt;VirtualHost&gt;</code>
1203 sections. Most, but not all, other directives can be used inside of a
1204 <code>&lt;Global&gt;</code> section.
1205
1206 <p>
1207 In addition, multiple <code>&lt;Global&gt;</code> sections can be used in the
1208 configuration file. At startup, all <code>&lt;Global&gt;</code> sections are
1209 combined, and then merged into each server's configuration.
1210 <code>&lt;Global&gt;</code> sections are closed by a matching
1211 <code>&lt;/Global&gt;</code> directive.
1212
1213 <hr>
1214 <h3><a name="Group">Group</a></h3>
1215 <strong>Syntax:</strong> Group <em>name</em><br>
1216 <strong>Default:</strong> None<br>
1217 <strong>Context:</strong> server config, <code>&lt;VirtualHost&gt;</code>, <code>&lt;Global&gt;</code>, <code>&lt;Anonymous&gt;</code><br>
1218 <strong>Module:</strong> mod_core<br>
1219 <strong>Compatibility:</strong> 0.99.0 and later
1220
1221 <p>
1222 The <code>Group</code> directive configures which GID ProFTPD will use when
1223 running. See the <a href="#User"><code>User</code></a> directive for details.
1224
1225 <hr>
1226 <h3><a name="GroupOwner">GroupOwner</a></h3>
1227 <strong>Syntax:</strong> GroupOwner <em>group-name|"~"</em><br>
1228 <strong>Default:</strong> None<br>
1229 <strong>Context:</strong> <code>&lt;Anonymous&gt;</code>, <code>&lt;Directory&gt;</code>, .ftpaccess<br>
1230 <strong>Module:</strong> mod_core<br>
1231 <strong>Compatibility:</strong> 0.99.0 and later
1232
1233 <p>
1234 The <code>GroupOwner</code> directive configures which group (via the
1235 <em>group-name</em> parameter) will own all newly created directories and files,
1236 within the configuration context that <code>GroupOwner</code> is set. The
1237 group ID of <em>group-name</em> <b>cannot</b> be 0.
1238
1239 <p>
1240 Note that <code>GroupOwner</code> cannot be used to override the operating
1241 system/filesystem user/group paradigm. If the current user is not a member of
1242 the specified group, new files and directories cannot be <code>chown()</code>ed
1243 to the <code>GroupOwner</code> group. If this happens, the <code>STOR</code>
1244 and <code>MKD</code>/<code>XMKD</code> FTP commands will succeed normally,
1245 however the new directory entries will be owned by the current user's default
1246 group (and a warning message logged). However, if you <i>also</i> use
1247 the <code>UserOwner</code> directive in the same configuration context, this
1248 restriction is lifted.
1249
1250 <p>
1251 Some operating systems (<i>e.g.</i> FreeBSD) will use the GID of the parent
1252 directory where the new file/directory is created, rather than GID of
1253 the logged-in user which creates the new file/directory. To force the GID
1254 of the newly created file to be that of the logged-in user, use:
1255 <pre>
1256 # The tilde (~) syntax uses the GID of the logged-in user
1257 GroupOwner ~
1258 </pre>
1259
1260 <p>
1261 See also: <a href="#UserOwner"><code>UserOwner</code></a>
1262
1263 <p>
1264 <hr>
1265 <h3><a name="HideFiles">HideFiles</a></h3>
1266 <strong>Syntax:</strong> HideFiles <em>[!]regex|"none"]</em><br>
1267 <strong>Default:</strong> None<br>
1268 <strong>Context:</strong> <code>&lt;Directory&gt;</code>, .ftpaccess<br>
1269 <strong>Module:</strong> mod_core<br>
1270 <strong>Compatibility:</strong> 1.2.7rc1 and later
1271
1272 <p>
1273 The <code>HideFiles</code> directive configures a <code>&lt;Directory&gt;</code>
1274 section to hide all directory entries, <i>e.g.</i> its files and
1275 sub-directories, that match the given <em>regex</em>. These files can still
1276 be operated on by other FTP commands (<code>DELE</code>, <code>RETR</code>,
1277 <i>etc</i>), as constrained by any applicable <code>&lt;Limit&gt;</code>
1278 sections; this can be modified using the <code>IgnoreHidden</code> directive.
1279
1280 <p>
1281 Since <code>&lt;Directory&gt;</code> configurations are inherited by
1282 sub-directories, the <em>none</em> keyword can be used to disable any
1283 inherited file hiding within a sub-directory. This usually occurs through the
1284 use of a <code>.ftpaccess</code> file.
1285
1286 <p>
1287 Examples:
1288 <pre>
1289 &lt;Directory /&gt;
1290 # Hide configuration and passwd files from view
1291 HideFiles &quot;(\\.conf|passwd)$&quot;
1292
1293 # ...or the same regex, without the quotes
1294 HideFiles (\.conf|passwd)$
1295
1296 # Using the ! prefix to "invert" the regular expression matching,
1297 # allow <b>only</b> .txt and .html files to be seen
1298 HideFiles !(\.txt|\.html)$
1299 &lt;/Directory&gt;
1300 </pre>
1301
1302 <p>
1303 See also: <a href="#HideGroup"><code>HideGroup</code></a>,
1304 <a href="#HideNoAccess"><code>HideNoAccess</code></a>,
1305 <a href="#HideUser"><code>HideUser</code></a>
1306
1307 <p>
1308 <hr>
1309 <h3><a name="HideGroup">HideGroup</a></h3>
1310 <strong>Syntax:</strong> HideGroup <em>group-name</em><br>
1311 <strong>Default:</strong> None<br>
1312 <strong>Context:</strong> <code>&lt;Anonymous&gt;</code>, <code>&lt;Directory&gt;</code><br>
1313 <strong>Module:</strong> mod_core<br>
1314 <strong>Compatibility:</strong> 0.99.0 and later
1315
1316 <p>
1317 The <code>HideGroup</code> directive configures a <code>&lt;Directory&gt;</code>
1318 or <code>&lt;Anonymous&gt;</code> section to hide all directory entries owned
1319 by the specified <em>group-name</em>. The <em>group-name</em> can also be
1320 <code>~</code> (tilde), which is evaluated as the <em>group-name</em> of
1321 the primary group of the logged-in user. This can be combined with a prefix
1322 <code>!</code> (exclamation point) character, <i>e.g.</i> "!~", to mean
1323 "any group that is not the primary group of the logged-in-user".
1324
1325 <p>
1326 Normally, hidden directories and files cannot be seen via <code>LIST</code> or
1327 <code>NLST</code> commands but can be operated on via other FTP commands
1328 (<code>CWD</code>, <code>DELE</code>, <code>RETR</code>, <i>etc</i>). This
1329 behavior can be modified via the <code>IgnoreHidden</code> directive.
1330
1331 <p>
1332 Examples:
1333 <pre>
1334 &lt;Directory <i>path</i>&gt;
1335 # Hide all files belonging to group 'wheel'
1336 HideGroup wheel
1337
1338 # Hide all files belonging to the primary group of the logged-in user
1339 HideGroup ~
1340
1341 # Hide all files that are NOT owned by the primary group of the logged-in
1342 # user
1343 HideGroup !~
1344 &lt;/Directory&gt;
1345 </pre>
1346
1347 <p>
1348 See also: <a href="#HideUser"><code>HideUser</code></a>, <a href="#HideNoAccess"><code>HideNoAccess</code></a>, <a href="#IgnoreHidden"><code>IgnoreHidden</code></a>
1349
1350 <hr>
1351 <h3><a name="HideNoAccess">HideNoAccess</a></h3>
1352 <strong>Syntax:</strong> HideNoAccess <em>on|off</em><br>
1353 <strong>Default:</strong> None<br>
1354 <strong>Context:</strong> <code>&lt;Anonymous&gt;</code>, <code>&lt;Directory&gt;</code><br>
1355 <strong>Module:</strong> mod_core<br>
1356 <strong>Compatibility:</strong> 0.99.0 and later
1357
1358 <p>
1359 The <code>HideNoAccess</code> directive configures a
1360 <code>&lt;Directory&gt;</code> or <code>&lt;Anonymous&gt;</code> section to
1361 hide all directory entries in a directory listing (<i>e.g.</i> via the
1362 <code>LIST</code> or <code>NLST</code> FTP commands) to which the current
1363 logged-in, authenticated user has no access. Normal Unix-style permissions
1364 <b>always</b> apply, so that although a user may not be able to see a directory
1365 entry that has "HideNoAccess on" applied, they will receive a normal
1366 "Permission denied" error message when attempting to blindly manipulate the
1367 file system object. The directory or file can be made completely invisible to
1368 all FTP commands by applying <code>IgnoreHidden</code> in conjunction with
1369 <code>HideNoAccess</code>.
1370
1371 <p>
1372 See also: <a href="#HideGroup"><code>HideGroup</code></a>, <a href="#HideUser"><code>HideUser</code></a>, <a href="#IgnoreHidden"><code>IgnoreHidden</code></a>
1373
1374 <hr>
1375 <h3><a name="HideUser">HideUser</a></h3>
1376 <strong>Syntax:</strong> HideUser <em>user-name</em><br>
1377 <strong>Default:</strong> None<br>
1378 <strong>Context:</strong> <code>&lt;Anonymous&gt;</code>, <code>&lt;Directory&gt;</code><br>
1379 <strong>Module:</strong> mod_core<br>
1380 <strong>Compatibility:</strong> 0.99.0 and later
1381
1382 <p>
1383 The <code>HideUser</code> directive configures a <code>&lt;Directory&gt;</code>
1384 or <code>&lt;Anonymous&gt;</code> section to hide all directory entries owned
1385 by the specified <em>user-name</em>. The <em>user-name</em> can also be
1386 <code>~</code> (tilde), which is evaluated as the <em>user-name</em> of
1387 the logged-in user. This can be combined with a prefix <code>!</code>
1388 (exclamation point) character, <i>e.g.</i> "!~", to mean "any user that is not
1389 the logged-in-user".
1390
1391 <p>
1392 Normally, hidden directories and files cannot be seen via <code>LIST</code> or
1393 <code>NLST</code> commands but can be operated on via other FTP commands
1394 (<code>CWD</code>, <code>DELE</code>, <code>RETR</code>, <i>etc</i>). This
1395 behavior can be modified via the <code>IgnoreHidden</code> directive.
1396
1397 <p>
1398 Examples:
1399 <pre>
1400 &lt;Directory <i>path</i>&gt;
1401 # Hide all files belonging to user 'root'
1402 HideUser root
1403
1404 # Hide all files belonging to the logged-in user
1405 HideUser ~
1406
1407 # Hide all files that are NOT owned by the logged-in user
1408 HideUser !~
1409 &lt;/Directory&gt;
1410 </pre>
1411
1412 <p>
1413 See also: <a href="#HideGroup"><code>HideGroup</code></a>, <a href="#HideNoAccess"><code>HideNoAccess</code></a>, <a href="#IgnoreHidden"><code>IgnoreHidden</code></a>
1414
1415 <p>
1416 <hr>
1417 <h3><a name="IgnoreHidden">IgnoreHidden</a></h3>
1418 <strong>Syntax:</strong> IgnoreHidden <em>on|off</em><br>
1419 <strong>Default:</strong> IgnoreHidden off<br>
1420 <strong>Context:</strong> <code>&lt;Limit&gt;</code><br>
1421 <strong>Module:</strong> mod_core<br>
1422 <strong>Compatibility:</strong> 0.99.0 and later
1423
1424 <p>
1425 The <code>IgnoreHidden</code> directive tells ProFTPD to <em>ignore</em>
1426 files/directories that are hidden by other directives, such as
1427 <code>HideFiles</code>, <code>HideUser</code>, and <code>HideGroup</code>.
1428
1429 <p>
1430 Normally, files marked as "hidden" by <code>HideFiles</code>,
1431 <code>HideUser</code> or <code>HideGroup</code> <i>can</i> be operated on by
1432 all FTP commands (assuming Unix file permissions allow access); these files
1433 simply do not appear in directory listings. Additionally, even when normal
1434 file system permissions <i>deny</i> access, ProFTPD returns a
1435 "Permission denied" error to the client, indicating that the requested
1436 file/directory <i>does</i> exist, even if the client cannot use it. The
1437 <code>IgnoreHidden</code> directive configures a <code>&lt;Limit&gt;</code>
1438 section so as to completely <em>ignore</em> any hidden directory entries for
1439 the set of FTP commands encompassed by the <code>&lt;Limit&gt;</code>. This
1440 has the effect of returning an error similar to "No such file or directory"
1441 when the client attempts to use the command upon a hidden directory or file.
1442
1443 <p>
1444 Example:
1445 <pre>
1446 &lt;Directory /&gt;
1447 # Hide files/directories owned by root
1448 HideUser root
1449
1450 # Hide Unix dot files
1451 HideFiles ^\.
1452
1453 &lt;Limit DIRS READ&gt;
1454 # Return "No such file or directory" for hidden files/directories
1455 IgnoreHidden on
1456 &lt;/Limit&gt;
1457 &lt;/Directory&gt;
1458 </pre>
1459
1460 <p>
1461 See also: <a href="#HideFiles"><code>HideFiles</code></a>,
1462 <a href="#HideGroup"><code>HideGroup</code></a>,
1463 <a href="#HideUser"><code>HideUser</code></a>
1464
1465 <p>
1466 <hr>
1467 <h3><a name="IfDefine">&lt;IfDefine&gt;</a></h3>
1468 <strong>Syntax:</strong> &lt;IfDefine <em>[!]label</em>&gt;<br>
1469 <strong>Default:</strong> None<br>
1470 <strong>Context:</strong> <em>any</em><br>
1471 <strong>Module:</strong> mod_core<br>
1472 <strong>Compatibility:</strong> 1.2.6rc1 and later
1473
1474 <p>
1475 The <code>&lt;IfDefine&gt;</code> and <code>&lt;/IfDefine&gt;</code> define
1476 a <i>conditional</i> configuration section. The directives appearing within
1477 that section are processed only if the <em>label</em> expression, used by
1478 <code>&lt;IfDefine&gt;</code>, is true/exists. Otherwise, everything within
1479 the configuration section is skipped.
1480
1481 <p>
1482 For example, assume you had something like the following in your
1483 <code>proftpd.conf</code>:
1484 <pre>
1485 &lt;IfDefine USE_TLS&gt;
1486 TLSEngine on
1487 TLSRequired on
1488 ...
1489 &lt;/IfDefine>
1490 </pre>
1491 Then you can enable that TLS functionality using the <code>-D</code>
1492 command-line option when starting ProFTPD, <i>e.g.</i>:
1493 <pre>
1494 $ /usr/local/sbin/proftpd -DUSE_TLS ...
1495 </pre>
1496
1497 <p>
1498 For configuration for which there are multiple conditions, you would use
1499 multiple nested <code>&lt;IfDefine&gt;</code> sections, <i>e.g.</i>:
1500 <pre>
1501 &lt;IfDefine USE_TLS&gt;
1502 TLSEngine on
1503
1504 &lt;IfDefine !REQUIRE_TLS&gt;
1505 # Require TLS for authentication, but allow clients to downgrade back
1506 # to plain TCP after that.
1507 TLSRequired auth
1508 &lt;/IfDefine&gt;
1509
1510 &lt;IfDefine REQUIRE_TLS&gt;
1511 # Require TLS for control and data connections
1512 TLSRequired on
1513 &lt;/IfDefine&gt;
1514 &lt;/IfDefine&gt;
1515 </pre>
1516
1517 <p>
1518 See also: <a href="#Define"><code>Define</code></a>
1519
1520 <p>
1521 <hr>
1522 <h3><a name="IfModule">&lt;IfModule&gt;</a></h3>
1523 <strong>Syntax:</strong> &lt;IfModule <em>[!]module-name</em>&gt;<br>
1524 <strong>Default:</strong> None<br>
1525 <strong>Context:</strong> <em>any</em><br>
1526 <strong>Module:</strong> mod_core<br>
1527 <strong>Compatibility:</strong> 1.2.6rc1 and later
1528
1529 <p>
1530 The <code>&lt;IfModule&gt;</code> and <code>&lt;/IfModule&gt;</code> define
1531 a <i>conditional</i> configuration section. The directives appearing within
1532 that section are processed only if the <em>module-name</em>, used by
1533 <code>&lt;IfModule&gt;</code>, is present/loaded. Otherwise, everything within
1534 the configuration section is skipped.
1535
1536 <p>
1537 The optional <em>!</em> character prefix to the <em>module-name</em> indicates
1538 that the section should be included if the named module is <b>not</b>
1539 present/loaded.
1540
1541 <p>
1542 An <code>&lt;IfModule&gt;</code> section is <b>not</b> a separate
1543 configuration context like <code>&lt;VirtualHost&gt;</code> or
1544 <code>&lt;Directory&gt;</code>. It is a condition, a way of telling the
1545 parse to include (or to skip) the enclosed section.
1546
1547 <p>
1548 Examples:
1549 <pre>
1550 &lt;IfModule mod_load.c&gt;
1551 MaxLoad 10 "Access denied, server too busy"
1552 &lt;/IfModule&gt;
1553 </pre>
1554
1555 <p>
1556 For configuration for which there are multiple modules required, you would use
1557 multiple nested <code>&lt;IfModule&gt;</code> sections, <i>e.g.</i>:
1558 <pre>
1559 &lt;IfModule mod_sql.c&gt;
1560 SQLEngine on
1561
1562 &lt;IfModule mod_sql_mysql.c&gt;
1563 # Use an SQLConnectInfo using MySQL parameters
1564 &lt;/IfModule&gt;
1565
1566 &lt;IfModule !mod_sql_mysql.c&gt;
1567 &lt;IfModule mod_sql_sqlite.c&gt;
1568 # No mod_sql_mysql, but we do have mod_sql_sqlite available;
1569 # use an SQLConnectInfo to a local SQLite database file.
1570 &lt;/IfModule&gt;
1571 &lt;/IfModule&gt;
1572
1573 &lt;IfModule mod_sql_passwd.c&gt;
1574 # Try more different password hashes with mod_sql_passwd
1575 SQLAuthTypes ...
1576 &lt;/IfModule&gt;
1577
1578 &lt;IfModule !mod_sql_passwd.c&gt;
1579 # Use only the basic SQLAuthTypes provided by mod_sql
1580 SQLAuthTypes Crypt OpenSSL
1581 &lt;/IfModule&gt;
1582 &lt;/IfModule&gt;
1583 </pre>
1584
1585 <p>
1586 See also: <a href="#Define"><code>Define</code></a>
1587
1588 <p>
1589 <hr>
1590 <h3><a name="Include">Include</a></h3>
1591 <strong>Syntax:</strong> Include <em>path|pattern</em><br>
1592 <strong>Default:</strong> None<br>
1593 <strong>Context:</strong> server config, <code>&lt;VirtualHost&gt;</code>, <code>&lt;Global&gt;</code>, <code>&lt;Anonymous&gt;</code>, <code>&lt;Limit&gt;</code>, <code>&lt;Directory&gt;</code><br>
1594 <strong>Module:</strong> mod_core<br>
1595 <strong>Compatibility:</strong> 1.2.10rc1 and later
1596
1597 <p>
1598 The <code>Include</code> directive allows inclusion of other configuration
1599 files from within the server configuration files.
1600
1601 <p>
1602 Shell-style (<code>fnmatch(3)</code>) wildcard characters can be used to
1603 include several files at once, in alphabetical order. (If no matches for
1604 the pattern are found, the <code>Include</code> directive is silently ignored.)
1605 In addition, if <code>Include</code> points to a directory, rather than a file,
1606 then <code>proftpd</code> will read all files in that directory. <b>Note</b>
1607 that including entire directories is <b>not</b> recommended, as it is easy to
1608 accidentally leave temporary files in a directory that can cause
1609 <code>proftpd</code> to fail.
1610
1611 <p>
1612 The <em>path</em> must be an absolute path.
1613
1614 <p>
1615 Examples:
1616 <pre>
1617 Include /etc/proftpd/conf/tls.conf
1618 Include /etc/proftpd/conf/vhosts/*.conf
1619 </pre>
1620
1621 <p>
1622 <b>Note</b> that an <code>Include</code> directive appearing inside of a
1623 <code>&lt;Limit&gt;</code> section which itself is in a <code>.ftpaccess</code>
1624 file will be ignored. <code>Include</code> directives are not allowed
1625 in <code>.ftpaccess</code> files, even indirectly.
1626
1627 <p>
1628 <hr>
1629 <h3><a name="IncludeOptions">IncludeOptions</a></h3>
1630 <strong>Syntax:</strong> IncludeOptions <em>opt1 ...</em><br>
1631 <strong>Default:</strong> None<br>
1632 <strong>Context:</strong> server config<br>
1633 <strong>Module:</strong> mod_core<br>
1634 <strong>Compatibility:</strong> 1.3.6rc3 and later
1635
1636 <p>
1637 The <code>IncludeOptions</code> directive is used to configure various optional
1638 behavior of <a href="#Include"><code>Include</code></a> directive. For
1639 example:
1640 <pre>
1641 IncludeOptions IgnoreTempFiles
1642 </pre>
1643
1644 <p>
1645 The currently implemented options are:
1646 <ul>
1647 <li><code>AllowSymlinks</code><br>
1648 <p>
1649 When the <code>Include</code> directive encounters symlinks, it will
1650 <i>skip</i> them by default; use this option to handle symlinks.
1651 </li>
1652
1653 <p>
1654 <li><code>IgnoreTempFiles</code><br>
1655 <p>
1656 Use this option to have the <code>Include</code> directive automatically
1657 <i>skip</i> any files which have extensions identifying them as commonly
1658 occurring temporary files.
1659 </li>
1660
1661 <p>
1662 <li><code>IgnoreWildcards</code><br>
1663 <p>
1664 Use this option to have the <code>Include</code> directive automatically
1665 <i>reject</i> any paths which include wildcards in the directory names.
1666 This can be done, for example, to prevent other <code>Include</code>d files
1667 from using wildcards without the administrator's consent.
1668 </li>
1669 </ul>
1670
1671 <p>
1672 <hr>
1673 <h3><a name="Limit">&lt;Limit&gt;</a></h3>
1674 <strong>Syntax:</strong> &lt;Limit <em>cmd-list</em>&gt;<br>
1675 <strong>Default:</strong> None<br>
1676 <strong>Context:</strong> server config, <code>&lt;VirtualHost&gt;</code>, <code>&lt;Global&gt;</code>, <code>&lt;Anonymous&gt;</code>, <code>&lt;Directory&gt;</code>, .ftpaccess<br>
1677 <strong>Module:</strong> mod_core<br>
1678 <strong>Compatibility:</strong> 0.99.0 and later
1679
1680 <p>
1681 The <code>&lt;Limit&gt;</code> section is used to place access restrictions on
1682 one or more FTP commands, within a given configuration section. Limits flow
1683 downward, so that a <code>&lt;Limit&gt;</code> section in the &quot;server
1684 config&quot; context applies to all <code>&lt;Directory&gt;</code> and
1685 <code>&lt;Anonymous&gt;</code> sections that also reside in that configuration.
1686 Any number of command parameters can be specified in the <em>cmd-list</em>,
1687 against which the contents of the <code>&lt;Limit&gt;</code> section will be
1688 applied.
1689
1690 <p>
1691 <code>&lt;Limit&gt;</code> command restrictions should <b>not</b> be confused
1692 with file/directory access permission. While limits can be used to
1693 <i>restrict</i> a command in a certain directory, they cannot be used to
1694 <i>override</i> the file permissions; limits <b>cannot</b> <i>grant</i> access
1695 if the underlying filesystem restricts access.
1696
1697 <p>
1698 More information on using <code>&lt;Limit&gt;</code> sections, including
1699 examples, can be found in the <a href="../howto/Limit.html"><code>&lt;Limit&gt;</code> howto</a>.
1700
1701 <p>
1702 <hr>
1703 <h3><a name="MasqueradeAddress">MasqueradeAddress</a></h3>
1704 <strong>Syntax:</strong> MasqueradeAddress <em>ip-address|dns-name|device-name</em><br>
1705 <strong>Default:</strong> None<br>
1706 <strong>Context:</strong> server config, <code>&lt;VirtualHost&gt;</code>, <code>&lt;Global&gt;</code><br>
1707 <strong>Module:</strong> mod_core<br>
1708 <strong>Compatibility:</strong> 1.2.2 and later
1709
1710 <p>
1711 The <code>MasqueradeAddress</code> directive causes the server to display the
1712 network information for the specified IP address or DNS hostname to the client
1713 in the responses to <code>PASV</code> and <code>EPSV</code> FTP commands, on
1714 the assumption that that IP address or DNS host is acting as a NAT gateway or
1715 port forwarder for the server. For example:
1716 <pre>
1717 MasqueradeAddress nat-gw.mydomain.com
1718 </pre>
1719
1720 <p>
1721 The <code>MasqueradeAddress</code> directive also handles a parameter which
1722 indicates the <em>device-name</em> (or <em>interface-name</em>); the IP address
1723 associated with this device/interface will be used. For example, you can
1724 use:
1725 <pre>
1726 MasqueradeAddress eth0
1727 </pre>
1728 Using the device/interface name is useful in cases where the same
1729 <code>proftpd.conf</code> file is going to be deployed to multiple different
1730 machines, which will have the same device/interface names but different IP
1731 addresses.
1732
1733 <p>
1734 <hr>
1735 <h3><a name="MaxCommandRate">MaxCommandRate</a></h3>
1736 <strong>Syntax:</strong> MaxCommandRate <em>count</em> <em>[secs]</em><br>
1737 <strong>Default:</strong> None<br>
1738 <strong>Context:</strong> server config, <code>&lt;VirtualHost&gt;</code>, <code>&lt;Global&gt;</code><br>
1739 <strong>Module:</strong> mod_core<br>
1740 <strong>Compatibility:</strong> 1.3.4rc2 and later
1741
1742 <p>
1743 The <code>MaxCommandRate</code> directive is used to configure a maximum
1744 number of commands per time interval, after which <code>proftpd</code> will
1745 start injecting a delay before handling the command. The more over the
1746 configured command/sec rate the client is, the longer the delay. This feature
1747 is used to "throttle" automated and/or malicious clients.
1748
1749 <p>
1750 For example:
1751 <pre>
1752 MaxCommandRate 200
1753 </pre>
1754 sets a maximum command rate of 200 commands per sec. Or:
1755 <pre>
1756 MaxCommandRate 500 2
1757 </pre>
1758 sets a maximum command rate of 500 commands every 2 seconds.
1759
1760 <p>
1761 <hr>
1762 <h3><a name="MaxConnectionRate">MaxConnectionRate</a></h3>
1763 <strong>Syntax:</strong> MaxConnectionRate <em>count</em> <em>[interval]</em><br>
1764 <strong>Default:</strong> None<br>
1765 <strong>Context:</strong> server config<br>
1766 <strong>Module:</strong> mod_core<br>
1767 <strong>Compatibility:</strong> 1.2.7rc1 and later
1768
1769 <p>
1770 The <code>MaxConnectionRate</code> directive is used to configure a maximum
1771 <em>count</em> of connections per time <em>interval</em> (in seconds). If
1772 this connection rate is reached, <code>proftpd</code> will simply close
1773 additional connections, until the connection rate drops below the threshold.
1774 The default <em>interval</em> is 1 second.
1775
1776 <p>
1777 For example:
1778 <pre>
1779 MaxConnectionRate 200
1780 </pre>
1781 sets a maximum connection rate of 200 connections per sec. Or:
1782 <pre>
1783 MaxConnectionRate 500 2
1784 </pre>
1785 sets a maximum connection rate of 500 connections every 2 seconds.
1786
1787 <p>
1788 <hr>
1789 <h3><a name="MaxInstances">MaxInstances</a></h3>
1790 <strong>Syntax:</strong> MaxInstances <em>count</em><br>
1791 <strong>Default:</strong> None<br>
1792 <strong>Context:</strong> server config<br>
1793 <strong>Module:</strong> mod_core<br>
1794 <strong>Compatibility:</strong> 1.1.6p11 and later
1795
1796 <p>
1797 The <code>MaxInstances</code> directive configures the maximum number of child
1798 (session) processes that may be spawned by the <code>proftpd</code> daemon
1799 process when running with "ServerType standalone" configured. The directive
1800 has no effect when <code>proftpd</code> is configured with "ServerType inetd".
1801
1802 <p>
1803 Each <code>proftpd</code> child process represents a single client connection,
1804 and thus this directive also controls the maximum number of simultaneous
1805 connections allowed. Additional connections beyond the configured limit are
1806 logged, and <b>silently disconnected</b>; the clients will <b>not</b> receive an
1807 FTP response in this case, but instead will encounter connection-level errors
1808 such as "Connection reset by peer". In order to provide a more user-facing
1809 error message, use the
1810 <a href="mod_auth.html#MaxClients"><code>MaxClients</code></a> directive,
1811 set to a value <em>lower</em> than <code>MaxInstances</code>, <i>e.g.</i>:
1812 <pre>
1813 # Set MaxClients lower than MaxInstances, so that clients receive a nicer error message when they are rejected.
1814 MaxClients 100
1815 MaxInstances 101
1816 </pre>
1817
1818 <p>
1819 The <code>MaxInstances</code> directive can be used to prevent undesirable
1820 denial-of-service attacks (<i>e.g.</i> by repeatedly connecting to the FTP
1821 control port, a malicious client could try to cause <code>proftpd</code> to
1822 repeatedly fork new processes, creating a "fork-bomb"). By default, no limit
1823 is placed on the number of child processes that may run at one time; it is
1824 <b>highly recommended</b> that a maximum number, suitable to your sites
1825 traffic, be configured.
1826
1827 <p>
1828 <hr>
1829 <h3><a name="Order">Order</a></h3>
1830 <strong>Syntax:</strong> Order <em>"allow,deny"|"deny,allow"</em><br>
1831 <strong>Default:</strong> Order allow,deny<br>
1832 <strong>Context:</strong> <code>&lt;Limit&gt;</code><br>
1833 <strong>Module:</strong> mod_core<br>
1834 <strong>Compatibility:</strong> 0.99.0p16 and later
1835
1836 <p>
1837 The <code>Order</code> directive configures the order in which
1838 <a href="#Allow"><code>Allow</code></a> and
1839 <a href="#Deny"><code>Deny</code></a> directives are checked inside of a
1840 <code>&lt;Limit&gt;</code> configuration section.
1841
1842 <p>
1843 <code>Allow</code> directives are permissive, and <code>Deny</code> directives
1844 restrictive, thus the <em>order</em> in which they are examined can
1845 significantly alter the way access control functions. If the default setting
1846 of <em>allow,deny</em> is used, then "allowed" access permissions are checked
1847 <em>first</em>. If an <code>Allow</code> directive explicitly allows access to
1848 the <code>&lt;Limit&gt;</code> section, access is granted, and any
1849 <code>Deny</code> directives are never checked. However, if <code>Allow</code>
1850 directives do not explicitly permit access, <code>Deny</code> directives are
1851 checked. And if any <code>Deny</code> directive applies, access is explicitly
1852 denied. Otherwise, access is granted.
1853
1854 <p>
1855 When <em>deny,allow</em> is used, <code>Deny</code> directive access
1856 restrictions are checked first. If any restriction applies, access is denied
1857 immediately. If nothing is denied, then <code>Allow</code> permissions are
1858 checked. If an <code>Allow</code> directive explicitly permits access, access
1859 is permitted; otherwise access is implicitly denied.
1860
1861 <p>
1862 For clarification, the following illustrates the steps used when checking
1863 <code>Allow</code>/<code>Deny</code> access:
1864 <ul>
1865 <li><em>Order allow,deny</em><br>
1866 <ul>
1867 <li>Check <code>Allow</code> directives; if one or more apply, <b>allow</b>
1868 <li>Check <code>Deny</code> directives; if one or more apply, <b>deny</b>
1869 <li>Otherwise, <b>allow</b>
1870 </ul>
1871 </li>
1872
1873 <p>
1874 <li><em>Order deny,allow</em><br>
1875 <ul>
1876 <li>Check <code>Deny</code> directives; if one or more apply, <b>deny</b>
1877 <li>Check <code>Allow</code> directives; if one or more apply, <b>allow</b>
1878 <li>Otherwise, <b>deny</b>
1879 </ul>
1880 </li>
1881 </ul>
1882
1883 <p>
1884 See also: <a href="#Allow"><code>Allow</code></a>,
1885 <a href="#Deny"><code>Deny</code></a>, <a href="#Limit"><code>&lt;Limit&gt;</code></a><br>
1886
1887 <p>
1888 <hr>
1889 <h3><a name="PassivePorts">PassivePorts</a></h3>
1890 <strong>Syntax:</strong> PassivePorts <em>min max</em><br>
1891 <strong>Default:</strong> None<br>
1892 <strong>Context:</strong> server config, <code>&lt;VirtualHost&gt;</code>, <code>&lt;Global&gt;</code><br>
1893 <strong>Module:</strong> mod_core<br>
1894 <strong>Compatibility:</strong> 1.2.0rc2 and later
1895
1896 <p>
1897 The <code>PassivePorts</code> directive restricts the range of ports from which
1898 the server will select, when the client sends the <code>PASV</code> or
1899 <code>EPSV</code> commands (<i>i.e.</i> requesting a passive data transfer).
1900 The server will randomly choose a number from within the specified range until
1901 an open port is found. <b>Should no open ports be found within the
1902 configured range, the server will default to a random kernel-assigned port,
1903 and a message logged.</b>
1904
1905 <p>
1906 The port range configured <b>must</b> be in the non-privileged range
1907 (<i>e.g.</i> greater than or equal to 1024); it is <b>STRONGLY RECOMMENDED</b>
1908 that the chosen range be large enough to handle many simultaneous passive
1909 connections (for example, 49152-65534, the IANA-registered ephemeral port
1910 range). The <b>smaller</b> your configured port range is, the greater the
1911 chance that all of those ports will be in use (depending on the traffic to your
1912 FTP server), and thus the greater the chance that a port outside that range
1913 will be configured.
1914
1915 <p>
1916 Example:
1917 <pre>
1918 # Use the IANA registered ephemeral port range
1919 PassivePorts 49152 65534
1920 </pre>
1921
1922 <p>
1923 <b>Note</b>: Many admins wonder why the recommended port range is so large.
1924 The answer is that there is really no value in having a small range. ProFTPD
1925 does <b>NOT</b> automatically listen on these ports. For those people who are
1926 worried about port scanning, having a larger <code>PassivePorts</code> range
1927 will not mean that port scans will show those ports as being open AND that
1928 something is listening there. Conversely, the question to ask yourself as
1929 an administrator is: why do you think you need such a small
1930 <code>PassivePorts</code> range?
1931
1932 <p>
1933 <hr>
1934 <h3><a name="PathAllowFilter">PathAllowFilter</a></h3>
1935 <strong>Syntax:</strong> PathAllowFilter <em>pattern [flags]</em><br>
1936 <strong>Default:</strong> None<br>
1937 <strong>Context:</strong> server config, <code>&lt;VirtualHost&gt;</code>, <code>&lt;Global&gt;</code>, <code>&lt;Anonymous&gt;</code>, <code>&lt;Directory&gt;</code>, .ftpaccess<br>
1938 <strong>Module:</strong> mod_core<br>
1939 <strong>Compatibility:</strong> 1.1.7 and later
1940
1941 <p>
1942 The <code>PathAllowFilter</code> directive allows the configuration of a
1943 regular expression <em>pattern</em> that <b>must be matched</b> for all newly
1944 uploaded (stored) files. The regular expression is applied against the entire
1945 pathname specified by the client, so care must be taken when creating a proper
1946 regex. Paths that fail the regex match result in a "Forbidden filename" error
1947 being returned to the client. If the regular expression <em>pattern</em>
1948 parameter contains whitespace, it must be enclosed in quotes.
1949
1950 <p>
1951 For example:
1952 <pre>
1953 # Only allow a-z 0-9 . - _ in file names
1954 PathAllowFilter ^[a-z0-9._-]+$
1955
1956 # As above but with upper case characters as well
1957 PathAllowFilter ^[A-Za-z0-9._-]+$
1958 </pre>
1959
1960 <p>
1961 The optional <em>flags</em> parameter, if present, modifies how the given
1962 <em>pattern</em> will be evaludated. The supported flags are:
1963 <ul>
1964 <li><b>nocase|NC</b> (<b>n</b>o <b>c</b>ase)<br>
1965 This makes the <em>pattern</em> case-insensitive, <i>i.e.</i> there is
1966 no difference between 'A-Z' and 'a-z' when <em>pattern</em> is matched
1967 against the path
1968 </li>
1969 </ul>
1970
1971 <p>
1972 The <a href="../howto/Filters.html">Filters</a> howto covers filtering in
1973 greater detail.
1974
1975 <p>
1976 See also: <a href="#PathDenyFilter"><code>PathDenyFilter</code></a>
1977
1978 <p>
1979 <hr>
1980 <h3><a name="PathDenyFilter">PathDenyFilter</a></h3>
1981 <strong>Syntax:</strong> PathDenyFilter <em>pattern [flags]</em><br>
1982 <strong>Default:</strong> None<br>
1983 <strong>Context:</strong> server config, <code>&lt;VirtualHost&gt;</code>, <code>&lt;Global&gt;</code>, <code>&lt;Anonymous&gt;</code>, <code>&lt;Directory&gt;</code>, .ftpaccess<br>
1984 <strong>Module:</strong> mod_core<br>
1985 <strong>Compatibility:</strong> 1.1.7 and later
1986
1987 <p>
1988 Similar to the <a href="#PathAllowFilter"><code>PathAllowFilter</code></a>
1989 directive, <code>PathDenyFilter</code> specifies a regular expression
1990 <em>pattern</em> which <b>must not match</b> any uploaded pathnames. If the
1991 regex does match, a "Forbidden filename" error is returned to the client.
1992 This can be especially useful for forbidding .ftpaccess or .htaccess files.
1993
1994 <p>
1995 For example:
1996 <pre>
1997 # We don't want .ftpaccess or .htaccess files to be uploaded
1998 PathDenyFilter "(\\.ftpaccess|\\.htaccess)$"
1999 </pre>
2000
2001 <p>
2002 The optional <em>flags</em> parameter, if present, modifies how the given
2003 <em>pattern</em> will be evaludated. The supported flags are:
2004 <ul>
2005 <li><b>nocase|NC</b> (<b>n</b>o <b>c</b>ase)<br>
2006 This makes the <em>pattern</em> case-insensitive, <i>i.e.</i> there is
2007 no difference between 'A-Z' and 'a-z' when <em>pattern</em> is matched
2008 against the path
2009 </li>
2010 </ul>
2011
2012 <p>
2013 The <a href="../howto/Filters.html">Filters</a> howto covers filtering in
2014 greater detail.
2015
2016 <p>
2017 See also: <a href="#PathAllowFilter"><code>PathAllowFilter</code></a>
2018
2019 <p>
2020 <hr>
2021 <h3><a name="PidFile">PidFile</a></h3>
2022 <strong>Syntax:</strong> PidFile <em>path</em><br>
2023 <strong>Default:</strong> PidFile <em>$prefix</em>/var/proftpd.pid<br>
2024 <strong>Context:</strong> server config<br>
2025 <strong>Module:</strong> mod_core<br>
2026 <strong>Compatibility:</strong> 1.2.0rc2 and later
2027
2028 <p>
2029 The <code>PidFile</code> directive configures the <em>path</em> to which the
2030 daemon process records its process ID (PID). The <em>path</em> must be an
2031 absolute path, <i>e.g.</i> <code>/var/run/proftpd/proftpd.pid</code>. The
2032 <code>PidFile</code> is only used in <a href="#ServerType">standalone</a> mode.
2033
2034 <p>
2035 It is often useful to be able to send the daemon a signal, so that it closes
2036 and then reopens its log files (<i>e.g.</i> ExtendedLog, TransferLog), and
2037 re-reads its configuration files. This is done by sending the
2038 <code>SIGHUP</code> signal to the PID contained in the <code>PidFile</code> --
2039 the PID of the daemon process.
2040
2041 <p>
2042 <hr>
2043 <h3><a name="Port">Port</a></h3>
2044 <strong>Syntax:</strong> Port <em>number</em><br>
2045 <strong>Default:</strong> Port 21<br>
2046 <strong>Context:</strong> server config, <code>&lt;VirtualHost&gt;</code>, <code>&lt;Global&gt;</code><br>
2047 <strong>Module:</strong> mod_core<br>
2048 <strong>Compatibility:</strong> 0.99.0 and later
2049
2050 <p>
2051 The <code>Port</code> directive configures the TCP port to which ProFTPD will
2052 listen while running in standalone mode. This directive has <em>no effect</em>
2053 when used on a server running in inetd mode; see
2054 <a href="#ServerType"><code>ServerType</code></a>. The directive can be used
2055 in conjunction with <a href="#VirtualHost"><code>&lt;VirtualHost&gt;</code></a>
2056 in order to run a virtual server on the same IP address as the master server,
2057 but listening on a different port.
2058
2059 <p>
2060 For any server, either <code>&lt;VirtualHost&gt;</code> <i>or</i> "server
2061 config", using a <em>number</em> value of zero (0) will effectively
2062 disable/turn off that server:
2063 <pre>
2064 &lt;VirtualHost ...&gt;
2065 # This virtual server is disabled because of this Port setting
2066 Port 0
2067
2068 ...
2069 &lt;/VirtualHost&gt;
2070 </pre>
2071
2072 <p>
2073 <hr>
2074 <h3><a name="ProcessTitles">ProcessTitles</a></h3>
2075 <strong>Syntax:</strong> ProcessTitles <em>terse|verbose</em><br>
2076 <strong>Default:</strong> ProcessTitles verbose<br>
2077 <strong>Context:</strong> server config<br>
2078 <strong>Module:</strong> mod_core<br>
2079 <strong>Compatibility:</strong> 1.3.4rc2 and later
2080
2081 <p>
2082 The <code>ProcessTitles</code> directive is used to tweak how
2083 <code>proftpd</code> modifies the process title for session processes.
2084
2085 <p>
2086 By default, <code>proftpd</code> updates the process title to show the current
2087 FTP command and its arguments for every session, <i>e.g.</i>:
2088 <pre>
2089 # ps aux | grep proftpd
2090 proftpd 30667 0.0 0.1 7304 1584 ? Ss 02:12 0:00 proftpd: (accepting connections)
2091 user1 31892 0.2 0.3 8004 3505 ? SL 20:13 0:12 proftpd: user1 - remote.client1.com: RETR file1.doc
2092 user2 31934 0.0 0.3 8004 3500 ? SL 21:27 0:00 proftpd: user2 - 4.3.2.1: STOR file2.zip
2093 user3 31891 0.2 0.3 8004 3504 ? SL 20:11 0:09 proftpd: user3 - remote.client2.com: RETR whatever.iso
2094 </pre>
2095 This is the same as having:
2096 <pre>
2097 ProcessTitles verbose
2098 </pre>
2099 in your proftpd.conf.
2100
2101 <p>
2102 To obscure the process titles, you can use:
2103 <pre>
2104 ProcessTitles terse
2105 </pre>
2106 which results in process titles which look like:
2107 <pre>
2108 # ps aux | grep proftpd
2109 proftpd 30667 0.0 0.1 7304 1584 ? Ss 02:12 0:00 proftpd: (accepting connections)
2110 user1 31892 0.2 0.3 8004 3505 ? SL 20:13 0:12 proftpd: processing connection
2111 user2 31934 0.0 0.3 8004 3500 ? SL 21:27 0:00 proftpd: processing connection
2112 user3 31891 0.2 0.3 8004 3504 ? SL 20:11 0:09 proftpd: processing connection
2113 </pre>
2114
2115 <p>
2116 <hr>
2117 <h3><a name="Protocols">Protocols</a></h3>
2118 <strong>Syntax:</strong> Protocols <em>protocol1 ...</em><br>
2119 <strong>Default:</strong> None<br>
2120 <strong>Context:</strong> server config, <code>&lt;VirtualHost&gt;</code>, <code>&lt;Global&gt;</code><br>
2121 <strong>Module:</strong> mod_core<br>
2122 <strong>Compatibility:</strong> 1.3.4rc1 and later
2123
2124 <p>
2125 The <code>Protocols</code> directive is used to enable/disable specific
2126 protocols support by the <code>proftpd</code> and its collection of modules.
2127 This directive can be used, in conjunction with the
2128 <a href="../contrib/mod_ifsession.html"><code>mod_ifsession</code></a> module,
2129 to enable certain features for specific users/groups/classes.
2130
2131 <p>
2132 The allowed protocols must be configured as a space-delimited list. For
2133 example:
2134 <pre>
2135 # Only enable FTPS and SFTP support, but not FTP or SCP
2136 Protocols ftps sftp
2137 </pre>
2138
2139 <p>
2140 The currently known/supported protocols include:
2141 <ul>
2142 <li><code>ftp</code><br>
2143 <li><code>ftps</code> (from <a href="../contrib/mod_tls.html"><code>mod_tls</code></a>)<br>
2144 <li><code>scp</code> (from <a href="../contrib/mod_sftp.html"><code>mod_sftp</code></a>)<br>
2145 <li><code>sftp</code> (from <a href="../contrib/mod_sftp.html"><code>mod_sftp</code></a>)<br>
2146 </ul>
2147
2148 <p>
2149 <hr>
2150 <h3><a name="RegexOptions">RegexOptions</a></h3>
2151 <strong>Syntax:</strong> RegexOptions <em>[Engine engine] [MatchLimit limit] [MatchRecursionLimit limit]</em><br>
2152 <strong>Default:</strong> None<br>
2153 <strong>Context:</strong> server config, <code>&lt;VirtualHost&gt;</code>, <code>&lt;Global&gt;</code><br>
2154 <strong>Module:</strong> mod_core<br>
2155 <strong>Compatibility:</strong> 1.3.5rc1 and later
2156
2157 <p>
2158 The <code>RegexOptions</code> directive configures <em>limits</em> that can
2159 be set on the handling of regular expressions. ProFTPD can use regular
2160 expressions for many things; some malicious clients may attempt <i>resource
2161 consumption</i> attacks by forcing these regular expressions into very
2162 memory/CPU-intensive matching. The <code>RegexOptions</code> directive can
2163 be used in such cases to enforce lower limits on the regular expression
2164 handling.
2165
2166 <p>
2167 The <a href="http://pcre.org/current/doc/html/pcre2api.html"><code>pcreapi</code></a> documentation talks more about what the <em>match limit</em> and <em>match
2168 recursion limit</em> values do.
2169
2170 <p>
2171 Note, however, that these limits are only used when
2172 <a href="http://pcre.org/">PCRE</a> support is enabled (via the
2173 <code>--enable-pcre</code> build-time option). If PCRE support is <em>not</em>
2174 enabled, this directive has no effect.
2175
2176 <p>
2177 The <em>Engine</em> parameter configures the particular implementation
2178 &quot;engine&quot; used for regular expressions; the value can be one of the
2179 following:
2180 <ul>
2181 <li>PCRE
2182 <li>PCRE2
2183 <li>POSIX
2184 </ul>
2185 This is most useful for specifying that ProFTPD should handle all regular
2186 expressions as POSIX expressions, regardless of any PCRE support, as there may
2187 be issues with the PCRE implementation.
2188
2189 <p>
2190 Support for the <em>Engine</em> parameter first appeared in ProFTPD 1.3.8rc2.
2191
2192 <p>
2193 <hr>
2194 <h3><a name="ScoreboardFile">ScoreboardFile</a></h3>
2195 <strong>Syntax:</strong> ScoreboardFile <em>path|"none"</em><br>
2196 <strong>Default:</strong> ScoreboardFile /usr/local/var/proftpd.scoreboard</br>
2197 <strong>Context:</strong> server config<br>
2198 <strong>Module:</strong> mod_core<br>
2199 <strong>Compatibility:</strong> 1.2.7rc1 and later
2200
2201 <p>
2202 The <code>ScoreboardFile</code> directive sets the path to the file where the
2203 daemon will store its run-time "scoreboard" session information. This file is
2204 necessary for support features such as
2205 <a href="mod_auth.html#MaxClients"><code>MaxClients</code></a> to work properly,
2206 as well as other utilities (such as <a href="../utils/ftpwho.html">ftpwho</a>,
2207 <a href="../utils/ftptop.html">ftptop</a>, and
2208 <a href="../utils/ftpcount.html">ftpcount</a>). <b>Note</b> that the directory
2209 containing the scoreboard <b>cannot</b> be world-writable.
2210
2211 <p>
2212 For performance reasons, it is <b>strongly recommended</b> that the
2213 <code>ScoreboardFile</code> path <i>not</i> be located on a networked
2214 filesystem, but rather be located on a local physical disk.
2215
2216 <p>
2217 In order to <i>disable</i> scoreboarding (which can increase performance,
2218 at the cost of functionality), any of the following can be used:
2219 <pre>
2220 ScoreboardFile /dev/null
2221 ScoreboardFile none
2222 ScoreboardFile off
2223 </pre>
2224 Please read the
2225 <a href="../howto/Scoreboard.html#ScoreboardDisabling">Scoreboard</a> howto
2226 before disabling scoreboarding.
2227
2228 <p>
2229 <hr>
2230 <h3><a name="ScoreboardMutex">ScoreboardMutex</a></h3>
2231 <strong>Syntax:</strong> ScoreboardMutex <em>path</em><br>
2232 <strong>Default:</strong> ScoreboardMutex /usr/local/var/proftpd.scoreboard.lck</br>
2233 <strong>Context:</strong> server config<br>
2234 <strong>Module:</strong> mod_core<br>
2235 <strong>Compatibility:</strong> 1.3.4rc1 and later
2236
2237 <p>
2238 The <code>ScoreboardMutex</code> directive sets the path to a "mutex" file
2239 which is used for scoreboard locking/synchronization; this mutex is used to
2240 increase the daemon's performance under load.
2241
2242 <p>
2243 For performance reasons, it is <b>strongly recommended</b> that the
2244 <code>ScoreboardMutex</code> path <i>not</i> be located on a networked
2245 filesystem, but rather be located on a local physical disk. It is best if
2246 the <code>ScoreboardMutex</code> be located in the same directory as the
2247 <a href="#ScoreboardFile"><code>ScoreboardFile</code></a>.
2248
2249 <p>
2250 <hr>
2251 <h3><a name="ScoreboardOptions">ScoreboardOptions</a></h3>
2252 <strong>Syntax:</strong> ScoreboardOptions <em>opt1 ...</em><br>
2253 <strong>Default:</strong> None<br>
2254 <strong>Context:</strong> server config, <code>&lt;VirtualHost&gt;</code>, <code>&lt;Global&gt;</code><br>
2255 <strong>Module:</strong> mod_core<br>
2256 <strong>Compatibility:</strong> 1.3.9rc1 and later
2257
2258 <p>
2259 The <code>ScoreboardOptions</code> directive is used to configure various
2260 optional behavior of the <a href="../howto/ScoreboardFile.html">scoreboard</a>.
2261
2262 <p>
2263 Example:
2264 <pre>
2265 ScoreboardOptions AllowMissingEntry
2266 </pre>
2267
2268 <p>
2269 The currently implemented options are:
2270 <ul>
2271 <li><code>AllowMissingEntry</code><br>
2272 <p>
2273 Under high load, it may not be possible to acquire an entry in the
2274 <code>ScoreboardFile</code> due to high contention. Clients will
2275 be disconnected when this happens, unless this option is specified.
2276
2277 <p>
2278 <b>Note</b> that this option first appeared in
2279 <code>proftpd-1.3.9rc1</code>.
2280 </li>
2281 </ul>
2282
2283 <p>
2284 <hr>
2285 <h3><a name="ScoreboardScrub">ScoreboardScrub</a></h3>
2286 <strong>Syntax:</strong> ScoreboardScrub <em>on|off|secs</em><br>
2287 <strong>Default:</strong> ScoreboardScrub on<br>
2288 <strong>Context:</strong> server config<br>
2289 <strong>Module:</strong> mod_core<br>
2290 <strong>Compatibility:</strong> 1.3.3rc1 and later
2291
2292 <p>
2293 The <code>ScoreboardScrub</code> directive configures the "scrubbing" of the
2294 <a href="../howto/Scoreboard.html"><code>ScoreboardFile</code></a>. Scrubbing
2295 can be turned <em>off</em> entirely (not recommended), left <em>on</em>,
2296 or configured to run at a custom interval (in seconds).
2297
2298 <p>
2299 Example:
2300 <pre>
2301 # Disable scoreboard scrubbing
2302 ScoreboardScrub off
2303
2304 # Scrub the scoreboard every 2 minutes
2305 ScoreboardScrub 120
2306 </pre>
2307
2308 <p>
2309 <hr>
2310 <h3><a name="ServerAdmin">ServerAdmin</a></h3>
2311 <strong>Syntax:</strong> ServerAdmin <em>email-address</em><br>
2312 <strong>Default:</strong> ServerAdmin root@host<br>
2313 <strong>Context:</strong> server config, <code>&lt;VirtualHost&gt;</code><br>
2314 <strong>Module:</strong> mod_core<br>
2315 <strong>Compatibility:</strong> 0.99.0 and later
2316
2317 <p>
2318 The <code>ServerAdmin</code> directive sets the <em>email address</em> of the
2319 administrator of the host.
2320
2321 <p>
2322 Example:
2323 <pre>
2324 ServerAdmin [email protected]
2325 </pre>
2326
2327 <p>
2328 <hr>
2329 <h3><a name="ServerAlias">ServerAlias</a></h3>
2330 <strong>Syntax:</strong> ServerAlias <em>hostname ...</em><br>
2331 <strong>Default:</strong> None<br>
2332 <strong>Context:</strong> server config, <code>&lt;VirtualHost&gt;</code>, <code>&lt;Global&gt;</code><br>
2333 <strong>Module:</strong> mod_core<br>
2334 <strong>Compatibility:</strong> 1.3.6rc1 and later
2335
2336 <p>
2337 The <code>ServerAlias</code> directive is used to configure a <em>hostname</em>
2338 for the virtual server, such than an FTP client can connect to that virtual
2339 server using the <code>HOST</code> command. In effect, you use
2340 <code>ServerAlias</code> to define the names that you want to support, for
2341 true name-based virtual hosting.
2342
2343 <p>
2344 For example, you could define a virtual host using an IP address, and
2345 explicitly add the <code>HOST</code> names which should be "hosted" (handled)
2346 by that virtual host configuration, like so:
2347 <pre>
2348 &lt;VirtualHost 1.2.3.4&gt;
2349 Port 21
2350 ServerAlias *.domain.com
2351 ServerAlias example.com
2352 ...
2353 &lt;/VirtualHost&gt;
2354 </pre>
2355 So an FTP client which connected to 1.2.3.4:21, and issued:
2356 <pre>
2357 HOST ftp.domain.com
2358 </pre>
2359 or:
2360 <pre>
2361 HOST example.com
2362 </pre>
2363 would be handled as one would expect.
2364
2365 <p>
2366 Defining a virtual host using DNS names would automatically handle the DNS
2367 name as a <code>ServerAlias</code>:
2368 <pre>
2369 &lt;VirtualHost example.com&gt;
2370 Port 21
2371 ...
2372 &lt;/VirtualHost&gt;
2373 </pre>
2374 would work just like:
2375 <pre>
2376 &lt;VirtualHost 1.2.3.4&gt;
2377 Port 21
2378 ServerAlias example.com
2379 ...
2380 &lt;/VirtualHost&gt;
2381 </pre>
2382 (assuming that "example.com" resolved to 1.2.3.4, of course).
2383
2384 <p>
2385 <hr>
2386 <h3><a name="ServerIdent">ServerIdent</a></h3>
2387 <strong>Syntax:</strong> ServerIdent <em>off|on "identification string"</em><br>
2388 <strong>Default:</strong> ServerIdent on "ProFTPD Server (server name) [hostname]"<br>
2389 <strong>Context:</strong> server config, <code>&lt;VirtualHost&gt;</code>, <code>&lt;Global&gt;</code><br>
2390 <strong>Module:</strong> mod_core<br>
2391 <strong>Compatibility:</strong> 1.2.0pre2 and later
2392
2393 <p>
2394 The <code>ServerIdent</code> directive sets the default message displayed when
2395 a new client connects. Setting this to <em>off</em> displays:
2396 <pre>
2397 [<i>hostname</i>] FTP server ready.
2398 </pre>
2399 If set to <em>on</em>, the directive can take an optional string argument,
2400 which will be displayed instead of the default text. Sites desiring to give
2401 out minimal information will probably want a setting like:
2402 <pre>
2403 ServerIdent on "FTP Server ready."
2404 </pre>
2405 which won't even reveal the hostname.
2406
2407 <p>
2408 As of <code>proftpd-1.3.6rc3</code> and later, the default message changed, such
2409 that the version information is <i>omitted</i>, becoming:
2410 <pre>
2411 "ProFTPD Server (server name) [hostname]"
2412 </pre>
2413
2414 <p>
2415 An example of a custom identification string might be:
2416 <pre>
2417 ServerIdent on "Welcome to ftp.linux.co.uk"
2418 </pre>
2419
2420 <p>
2421 Note that the following variables can be used in the configured
2422 <code>ServerIdent</code> text:
2423 <ul>
2424 <li><code>%L</code> (<i>server IP address</i>)
2425 <li><code>%V</code> (<i>server fully-qualified domain name</i>)
2426 <li><code>%v</code> (<i><a href="#ServerName"><code>ServerName</code></a></i>)
2427 <li><code>%{version}</code> (<i>ProFTPD version</i>)
2428 </ul>
2429 For example:
2430 <pre>
2431 ServerIdent on "Welcome to %v"
2432 </pre>
2433
2434 <p>
2435 <hr>
2436 <h3><a name="ServerName">ServerName</a></h3>
2437 <strong>Syntax:</strong> ServerName <em>"standalone"|"inetd"</em><br>
2438 <strong>Default:</strong> ServerName "ProFTPD"
2439 <strong>Context:</strong> server config, <code>&lt;VirtualHost&gt;</code><br>
2440 <strong>Module:</strong> mod_core<br>
2441 <strong>Compatibility:</strong> 0.99.0 and later
2442
2443 <p>
2444 The <code>ServerName</code> directive configures the text that will be
2445 displayed to a client connecting to the server. This text will be displayed
2446 to the client <i>e.g.</i> as part of the response for a <code>HELP</code>
2447 or <code>STAT</code> command.
2448
2449 <p>
2450 <hr>
2451 <h3><a name="ServerType">ServerType</a></h3>
2452 <strong>Syntax:</strong> ServerType <em>"standalone"|"inetd"</em><br>
2453 <strong>Default:</strong> ServerType standalone<br>
2454 <strong>Context:</strong> server config<br>
2455 <strong>Module:</strong> mod_core<br>
2456 <strong>Compatibility:</strong> 0.99.0 and later
2457
2458 <p>
2459 The <code>ServerType</code> directive configures the <code>proftpd</code>
2460 server operating mode. The parameter can either be <em>inetd</em> or
2461 <em>standalone</em>.
2462
2463 <p>
2464 A parameter value of <em>inetd</em> configures <code>proftpd</code> to expect
2465 to be run from the <code>inetd</code>/<code>xinetd</code> "super server." New
2466 connections are passed from <code>inetd</code>/<code>xinetd</code> to
2467 <code>proftpd</code> and are processed immediately.
2468
2469 <p>
2470 A parameter value of <em>standalone</em> configures <code>proftpd</code> to
2471 start up on its own, and to begin listening to the configured addresses/ports
2472 for incoming connections. New connections result in forked child processes
2473 dedicated to processing all requests from the newly connected client.
2474
2475 <p>
2476 <hr>
2477 <h3><a name="SetEnv">SetEnv</a></h3>
2478 <strong>Syntax:</strong> SetEnv <em>name value</em><br>
2479 <strong>Default:</strong> None<br>
2480 <strong>Context:</strong> server config, <code>&lt;Virtual&gt;</code>, <code>&lt;Global&gt;</code><br>
2481 <strong>Module:</strong> mod_core<br>
2482 <strong>Compatibility:</strong> 1.2.10rc1 and later
2483
2484 <p>
2485 The <code>SetEnv</code> directive is used to set the environment variable
2486 <em>name</em> to <em>value</em> in session processes. Note that if
2487 <code>SetEnv</code> is used in the &quot;server config&quot; configuration
2488 context, the configured environment value will be set for the ProFTPD daemon
2489 process as well.
2490
2491 <p>
2492 Examples:
2493 <pre>
2494 # Set the TZ environment variable
2495 SetEnv TZ GMT
2496 </pre>
2497
2498 <p>
2499 See also: <a href="#UnsetEnv"><code>UnsetEnv</code></a>
2500
2501 <p>
2502 <hr>
2503 <h3><a name="SocketBindTight">SocketBindTight</a></h3>
2504 <strong>Syntax:</strong> SocketBindTight <em>on|off</em><br>
2505 <strong>Default:</strong> <em>off</em><br>
2506 <strong>Context:</strong> server config<br>
2507 <strong>Module:</strong> mod_core<br>
2508 <strong>Compatibility:</strong> 0.99.0pl6 and later
2509
2510 <p>
2511 The <code>SocketBindTight</code> directive controls how <code>proftpd</code>
2512 creates and binds its initial TCP listening sockets in "ServerType standalone"
2513 mode (see <a href="#ServerType"><code>ServerType</code></a>). This directive
2514 has no effect upon servers running with "ServerType inetd", because
2515 the TCP listening sockets in that mode are not needed or created by
2516 <code>proftpd</code>.
2517
2518 <p>
2519 When <code>SocketBindTight</code> is set to <em>off</em> (the default), a
2520 single TCP listening socket is created for each port that the server must
2521 listen on, regardless of the number of IP addresses being used by
2522 <code>&lt;VirtualHost&gt;</code> configurations. This has the benefit of
2523 requiring a relatively small number of file descriptors (one for each socket)
2524 for the master daemon process, even if a large number of virtual servers are
2525 configured. Each of these listening sockets is bound to the "wildcard"
2526 address, meaning that on all IP addresses on that port (<i>e.g.</i> "*:21").
2527
2528 <p>
2529 When <code>SocketBindTight</code> is set to <em>on</em>, a TCP listening socket
2530 is created and bound to <i>a specific IP address</i> for the main "server
2531 config" server and all configured virtual servers. This allows for situations
2532 where an administrator may wish to have a particular port be used by both
2533 <code>proftpd</code> (on one IP address) and another daemon (on a different IP
2534 address). The drawback is that considerably more file descriptors will be
2535 required <b>if a large number</b> of virtual servers must be supported.
2536
2537 <p>
2538 Here's an example. Two servers have been configured (one "server config" and
2539 one <code>&lt;VirtualHost&gt;</code>), with the IP addresses 10.0.0.1 and
2540 10.0.0.2, respectively. The 10.0.0.1 server runs on port 21, while 10.0.0.2
2541 runs on port 2001.
2542
2543 <p>
2544 If we use:
2545 <pre>
2546 SocketBindTight off
2547 </pre>
2548 then <code>proftpd</code> creates two sockets, both bound to <b>all</b>
2549 available addresses; one socket listens on port 21 (<i>i.e.</i> "*:21"), the
2550 other on port 2001 (<i>i.e.</i> "*.2001"). Since each socket is bound to all
2551 available addresses, no other daemon or process will be allowed to bind to
2552 ports 21 or 2001.
2553
2554 <p>
2555 On the other hand, if we use:
2556 <pre>
2557 SocketBindTight on
2558 </pre>
2559 then <code>proftpd</code> again creates two sockets. However one is bound to
2560 10.0.0.1, port 21 (<i>i.e.</i> "10.0.0.1:21") and the other is bound to
2561 10.0.0.2, port 2001 (<i>i.e.</i> "10.0.0.2:2001"). Thus these sockets are
2562 <em>tightly</em> bound to the IP addresses. This means that port 21 can be
2563 reused on any address <i>other</i> than 10.0.0.1, and similarly for port 2001
2564 and 10.0.0.2.
2565
2566 <p>
2567 One side effect of setting <code>SocketBindTight</code> to <em>on</em> is that
2568 connections to non-bound addresses will result in a "connection refused"
2569 message rather than the more common (<i>assuming</i> no <a href="#DefaultServer"><code>DefaultServer</code></a> directive):
2570 <pre>
2571 500 Sorry, no server available to handle request on <i>a.b.c.d.</i>
2572 </pre>
2573 due to the fact that no TCP listening socket has been bound to the particular
2574 address/port pair. This may or may not be aesthetically desirable, depending
2575 on your circumstances.
2576
2577 <p>
2578 See also: <a href="#DefaultServer"><code>DefaultServer</code></a>
2579
2580 <p>
2581 <hr>
2582 <h3><a name="SocketOptions">SocketOptions</a></h3>
2583 <strong>Syntax:</strong> SocketOptions <em>[maxseg <i>byte-count</i>] [rcvbuf <i>byte-count</i>] [sndbuf <i>byte-count</i>] [keepalive "on"|"off"|spec] [reuseport "on"|"off"]</em><br>
2584 <strong>Default:</strong> None<br>
2585 <strong>Context:</strong> server config, <code>&lt;VirtualHost&gt;</code><br>
2586 <strong>Module:</strong> mod_core<br>
2587 <strong>Compatibility:</strong> 1.2.9rc1 and later
2588
2589 <p>
2590 The <code>SocketOptions</code> directive is used to tune various socket-level
2591 options. The <em>rcvbuf</em> and <em>sndbuf</em> parameters are used for
2592 setting the TCP send/receive window sizes. The <em>maxseg</em> parameter is
2593 used for setting a MSS (Maximum Segment Size) via <code>setsockopt(2)</code>'s
2594 <code>TCP_MAXSEG</code> option. If the MSS is larger than the network
2595 interface's MTU, it is ignored and has no effect.
2596
2597 <p>
2598 Examples:
2599 <pre>
2600 # Use buffer sizes of 32KB for both reading and writing
2601 SocketOptions rcvbuf 32768 sndbuf 32768
2602 </pre>
2603
2604 <p>
2605 In <code>proftpd-1.3.5rc1</code>, the <code>SocketOptions</code> directive
2606 gained support for the <em>keepalive</em> parameter. By default,
2607 <code>proftpd</code> enables TCP keepalives on all of its connections,
2608 both control and data. To disable use of TCP keepalives, use:
2609 <pre>
2610 SocketOptions keepalive off
2611 </pre>
2612 while to have TCP keepalives explicitly enabled in the config, you would use:
2613 <pre>
2614 SocketOptions keepalive on
2615 </pre>
2616
2617 <p>
2618 The <em>keepalive</em> parameter also handles an argument in the form of
2619 a "keepalive-spec", which is a colon-separated string of three numeric values:
2620 <i>idle-secs</i>, <i>probe-count</i>, and <i>interval-secs</i>. On most TCP
2621 stacks, the default TCP keepalive behavior uses 2 hours as the time (per
2622 recommendation in RFC 1122), with 9 probes at 75 seconds between each probe.
2623 Using the <em>keepalive</em> parameter, this would be configured as:
2624 <pre>
2625 SocketOption keepalive 7200:9:75
2626 </pre>
2627 The first number (<i>idle-secs</i>) indicates the number of seconds the TCP
2628 connection must be idle before the first TCP keepalive probe is sent. Once
2629 the <i>idle-secs</i> time has passed, the TCP stack will send a number of
2630 "probes", trying to elicit a response (<code>ACK</code>, <code>RST</code>,
2631 <i>etc</i>) from the remote peer; the number of probes sent is configured by
2632 the second number (<i>probe-count</i>). The probes will be sent out at
2633 intervals governed by the third number (<i>interval-secs</i>), which configures
2634 the number of seconds between each keepalive probe.
2635
2636 <p>
2637 <b>Note</b> that not all platforms support configuring the idle, count, and
2638 interval values of the TCP keepalive behavior in their TCP stack. On such
2639 platforms, if the <em>keepalive</em> spec format is used, <i>e.g.</i>:
2640 <pre>
2641 SocketOptions keepalive 7500:9:75
2642 </pre>
2643 and <code>proftpd</code> knows that it cannot alter the TCP keepalive values,
2644 then <code>proftpd</code> will assume that the <em>keepalive</em> configuration
2645 is equivalent to:
2646 <pre>
2647 SocketOptions keepalive on
2648 </pre>
2649
2650 <p>
2651 In <code>proftpd-1.3.8rc4</code>, the <code>SocketOptions</code> directive
2652 gained support for the <em>reuseport</em> parameter. By default,
2653 <code>proftpd</code> does <b>not</b> enable the TCP "reuse port" value.
2654 However, this setting can be useful in very specific situations. To enable
2655 TCP port reuse for the control socket, use:
2656 <pre>
2657 SocketOptions reuseport on
2658 </pre>
2659
2660 <p>
2661 <hr>
2662 <h3><a name="SyslogFacility">SyslogFacility</a></h3>
2663 <strong>Syntax:</strong> SyslogFacility <em>facility</em><br>
2664 <strong>Default:</strong> SyslogFacility daemon<br>
2665 <strong>Context:</strong> server config<br>
2666 <strong>Module:</strong> mod_core<br>
2667 <strong>Compatibility:</strong> 1.1.6 and later
2668
2669 <p>
2670 By default, ProFTPD logs its activity via the Unix syslog mechanism, which
2671 allows for several different general classifications of logging messages,
2672 known as "facilities." Normally, all authentication related messages are
2673 logged with the <code>AUTHPRIV</code> (or <code>AUTH</code>) facility
2674 (since these messages are intended to be secure, and never seen by unwanted
2675 eyes), while normal operational messages are logged with the
2676 <code>DAEMON</code> facility. The <code>SyslogFacility</code> directive
2677 allows <b>all</b> logging messages to be directed to a different facility than
2678 the default.
2679
2680 <p>
2681 When this directive is used, <b>all</b> logging is done with the specified
2682 <em>facility</em>, both authentication (secure) and otherwise. The
2683 <em>facility</em> argument must be one of the following:
2684 <ul>
2685 <li><code>AUTH</code> (or <code>AUTHPRIV</code>)
2686 <li><code>CRON</code>
2687 <li><code>DAEMON</code>
2688 <li><code>FTP</code>
2689 <li><code>KERN</code>
2690 <li><code>LPR</code>
2691 <li><code>MAIL</code>
2692 <li><code>NEWS</code>
2693 <li><code>USER</code>
2694 <li><code>UUCP</code>
2695 <li><code>LOCAL0</code>
2696 <li><code>LOCAL1</code>
2697 <li><code>LOCAL2</code>
2698 <li><code>LOCAL3</code>
2699 <li><code>LOCAL4</code>
2700 <li><code>LOCAL5</code>
2701 <li><code>LOCAL6</code>
2702 <li><code>LOCAL7</code>
2703 </ul>
2704 For more information on syslog facilities, see the <code>syslog.conf</code>
2705 man page.
2706
2707 <p>
2708 The <a href="../howto/Logging.html#Syslog">Logging</a> howto covers logging in
2709 greater detail.
2710
2711 <p>
2712 See also: <a href="#SyslogLevel"><code>SyslogLevel</code></a>,
2713 <a href="mod_log.html#SystemLog"><code>SystemLog</code></a>
2714
2715 <p>
2716 <hr>
2717 <h3><a name="SyslogLevel">SyslogLevel</a></h3>
2718 <strong>Syntax:</strong> SyslogLevel <em>level</em><br>
2719 <strong>Default:</strong> SyslogLevel notice<br>
2720 <strong>Context:</strong> server config<br>
2721 <strong>Module:</strong> mod_core<br>
2722 <strong>Compatibility:</strong> 1.2.0rc2 and later
2723
2724 <p>
2725 The <code>SyslogLevel</code> directive adjusts the verbosity of the messages
2726 recorded via the default Unix syslog logging. The following <em>levels</em>
2727 are available, in order of decreasing significance:
2728
2729 <p>
2730 <table border=1 summary="Syslog Levels">
2731 <tr>
2732 <td><b>Level</b></td>
2733 <td><b>Description</b></td>
2734 </tr>
2735
2736 <tr>
2737 <td><code>emerg</code></td>
2738 <td>Emergencies (<i>e.g.</i> the system is unusable)</td>
2739 </tr>
2740
2741 <tr>
2742 <td><code>alert</code></td>
2743 <td>Action must be taken immediately</td>
2744 </tr>
2745
2746 <tr>
2747 <td><code>crit</code></td>
2748 <td>Critical conditions</td>
2749 </tr>
2750
2751 <tr>
2752 <td><code>error</code></td>
2753 <td>Error conditions</td>
2754 </tr>
2755
2756 <tr>
2757 <td><code>warn</code></td>
2758 <td>Warning conditions</td>
2759 </tr>
2760
2761 <tr>
2762 <td><code>notice</code></td>
2763 <td>Normal but significant conditions</td>
2764 </tr>
2765
2766 <tr>
2767 <td><code>info</code></td>
2768 <td>Informational</td>
2769 </tr>
2770
2771 <tr>
2772 <td><code>debug</code></td>
2773 <td>Debug-level messages</td>
2774 </tr>
2775 </table>
2776 See also the <a href="../howto/LogLevels.html">Log Levels</a> docs.
2777
2778 <p>
2779 When a particular <em>level</em> is specified, messages from all other levels
2780 of higher significance will be reported as well. For example, when:
2781 <pre>
2782 SyslogLevel info
2783 </pre>
2784 is configured, then messages with log levels of <code>notice</code> and
2785 <code>warn</code> will also be logged. Using a level of at least
2786 <code>crit</code> is recommended.
2787
2788 <p>
2789 The <a href="../howto/Logging.html#Syslog">Logging</a> howto covers logging in
2790 greater detail.
2791
2792 <p>
2793 See also: <a href="#SyslogFacility"><code>SyslogFacility</code></a>,
2794 <a href="mod_log.html#SystemLog"><code>SystemLog</code></a>
2795
2796 <p>
2797 <hr>
2798 <h3><a name="TCPBacklog">TCPBacklog</a></h3>
2799 <strong>Syntax:</strong> TCPBacklog <em>backlog-size</em><br>
2800 <strong>Default:</strong> <em>system</em><br>
2801 <strong>Context:</strong> server config<br>
2802 <strong>Module:</strong> mod_core<br>
2803 <strong>Compatibility:</strong> 0.99.0 and later
2804
2805 <p>
2806 The <code>TCPBacklog</code> directive controls the TCP connection queue size
2807 for listening sockets; this directive only applies to <code>proftpd</code>
2808 when it is configured with "<code>ServerType standalone</code>". It has
2809 <b>no effect</b> if "<code>ServerType inetd</code>" is configured.
2810
2811 <p>
2812 When a TCP connection is established by the TCP/IP stack within the kernel,
2813 there is a short period of time between the actual establishment of the
2814 TCP connection and when that connection is accepted for use by the listening
2815 daemon via the <code>accept(2)</code> system call. The duration of this period
2816 of time can vary quite a bit, and can depend upon several factors (<i>e.g.</i>
2817 hardware, system load, <i>etc</i>). Any TCP connection which hasn't been
2818 accepted by the listening daemon is placed in a "backlog" or queue of pending
2819 connections. The <code>TCPBacklog</code> directive controls how the size
2820 of this queue of pending connections.
2821
2822 <p>
2823 If this queue of pending connections becomes full, new TCP connections
2824 <b>cannot</b> be estaslished. Under heavy load, this can result in occasional
2825 (or even frequent) errors seen by clients, such as "Connection refused",
2826 even though the daemon is clearly running.
2827
2828 <p>
2829 The larger the <em>backlog-size</em>, the more TCP connections can be
2830 established to the daemon. This also means more kernel memory and other kernel
2831 resources.
2832
2833 <p>
2834 The issue is complicated further by the fact that different operating
2835 systems handle the <em>backlog-size</em> value differently. The pending
2836 connection queue is a critical kernel-level structure, and is sensitive
2837 to <a href="http://en.wikipedia.org/wiki/Syn_flood">TCP syn floods</a>.
2838 Each operating system, then, has different ways of handling incoming and
2839 pending connections, to attempt to guard against such attacks. For Linux
2840 systems, read the <code>tcp(7)</code> man page and specifically about
2841 <code>tcp_abort_on_overflow</code>, <code>tcp_max_syn_backlog</code>,
2842 and <code>tcp_syncookies</code>. On FreeBSD, read the
2843 <code>syncookies(4)</code> man page. And read
2844 <a href="http://www.sean.de/Solaris/soltune.html#backlog">here</a> for
2845 additional tuning considerations on Solaris.
2846
2847 <p>
2848 <hr>
2849 <h3><a name="TCPNoDelay">TCPNoDelay</a></h3>
2850 <strong>Syntax:</strong> TCPNoDelay <em>on|off</em><br>
2851 <strong>Default:</strong> TCPNoDelay on<br>
2852 <strong>Context:</strong> server config, <code>&lt;VirtualHost&gt;</code>, <code>&lt;Global&gt;</code><br>
2853 <strong>Module:</strong> mod_core<br>
2854 <strong>Compatibility:</strong> 1.2.0 and later
2855
2856 <p>
2857 The <code>TCPNoDelay</code> directive affects the use of the <a href="https://en.wikipedia.org/wiki/Nagle's_algorithm">Nagle algorithm</a>. <b>Note</b> that
2858 most sites will <em>never need this</em>.
2859
2860 <p>
2861 <hr>
2862 <h3><a name="TimeoutIdle">TimeoutIdle</a></h3>
2863 <strong>Syntax:</strong> TimeoutIdle <em>seconds</em><br>
2864 <strong>Default:</strong> 600 seconds<br>
2865 <strong>Context:</strong> server config, <code>&lt;VirtualHost&gt;</code>, <code>&lt;Global&gt;</code>, <code>&lt;Anonymous&gt;</code><br>
2866 <strong>Module:</strong> mod_core<br>
2867 <strong>Compatibility:</strong> 0.99.0 and later
2868
2869 <p>
2870 The <code>TimeoutIdle</code> directive configures the maximum number of
2871 <em>seconds</em> that <code>proftpd</code> will allow clients to stay connected
2872 without receiving any data on either the control or data connection. If data
2873 are received on either connection, the idle timer is reset. Setting
2874 <code>TimeoutIdle</code> to zero disables the idle timer completely, meaning
2875 that clients can stay connected forever, without sending data. <b>Note</b>:
2876 this is generally a <b>very bad idea</b>, as a "hung" TCP connection which is
2877 never properly disconnected (<i>e.g.</i> the remote network may have become
2878 disconnected from the Internet, <i>etc</i>) will cause a session process to
2879 never exit, until manually killed. This session process will thus linger, using
2880 up one of the <a href="#MaxInstances"><code>MaxInstances</code></a> as well as
2881 any of the other configured limits. The maximum allowed <em>seconds</em> value
2882 is 65535 (18 hours).
2883
2884 <p>
2885 See also: <a href="mod_auth.html#TimeoutLogin"><code>TimeoutLogin</code></a>,
2886 <a href="mod_xfer.html#TimeoutNoTransfer"><code>TimeoutNoTransfer</code></a>,
2887 <a href="mod_xfer.html#TimeoutStalled"><code>TimeoutStalled</code></a>.
2888
2889 <p>
2890 <hr>
2891 <h3><a name="TimeoutLinger">TimeoutLinger</a></h3>
2892 <strong>Syntax:</strong> TimeoutLinger <em>seconds</em><br>
2893 <strong>Default:</strong> 10<br>
2894 <strong>Context:</strong> server config, <code>&lt;VirtualHost&gt;</code>, <code>&lt;Global&gt;</code><br>
2895 <strong>Module:</strong> mod_core<br>
2896 <strong>Compatibility:</strong> 1.2.10rc2 and later
2897
2898 <p>
2899 The <code>TimeoutLinger</code> directive configures the maximum number of
2900 seconds that <code>proftpd</code> will wait (or "linger") when closing a data
2901 connection (<i>i.e.</i> for uploads, downloads, and directory listings). Once
2902 the data connection is closed, <code>proftpd</code> will send a response
2903 message ("226 Transfer complete") on the control connection indicating the
2904 closure. This delay is necessary for properly handling some FTP clients.
2905
2906 <p>
2907 If the client aborts a transfer and there is a long delay, this lingering close
2908 is the most likely culprit. So if you encounter this delay, set
2909 <code>TimeoutLinger</code> to a low number to remove the delay. The maximum
2910 allowed <em>seconds</em> is 65535 (18 hours).
2911
2912 <p>
2913 For the curious, here are the full details: some FTP clients will close their
2914 end of a data connection as soon as they are done sending their data; other
2915 FTP clients will wait until the server closes its end of the data connection,
2916 and some will close their side of the data connection <i>only after</i> they
2917 receive the "226 Transfer complete" message on the control connection. In
2918 order to ensure that all of the data has been transferred on a data connection,
2919 <code>proftpd</code> will "linger" for a certain amount of time (governed
2920 by the <code>TimeoutLinger</code> directive) before sending that
2921 "226 Transfer complete" response, thus giving all client behaviors a chance
2922 to do the right thing. However, this means that some clients will see a
2923 this <code>TimeoutLinger</code> delay unnecessarily. The <code>proftpd</code>
2924 daemon can't detect which type of behavior the client will use, so it is
2925 up to the site admin to configure <code>proftpd</code> to work best with
2926 their FTP clients.
2927
2928 <p>
2929 <hr>
2930 <h3><a name="TimesGMT">TimesGMT</a></h3>
2931 <strong>Syntax:</strong> TimesGMT <em>on|off</em><br>
2932 <strong>Default:</strong> TimesGMT on<br>
2933 <strong>Context:</strong> server config, <code>&lt;VirtualHost&gt;</code>, <code>&lt;Global&gt;</code>, <code>&lt;Anonymous&gt;</code><br>
2934 <strong>Module:</strong> mod_core<br>
2935 <strong>Compatibility:</strong> 1.2.0 and later
2936
2937 <p>
2938 The <code>TimesGMT</code> directive configures whether ProFTPD will use
2939 timestamps in GMT, not local time, for directory listings (via
2940 <code>LIST</code> and <code>NLST</code> commands) and the <code>MDTM</code>
2941 command.
2942
2943 <p>
2944 To configure ProFTPD to use local time, use:
2945 <pre>
2946 TimesGMT off
2947 </pre>
2948
2949 <p>
2950 <hr>
2951 <h3><a name="Trace">Trace</a></h3>
2952 <strong>Syntax:</strong> Trace <em>channel1:level1 ...</em><br>
2953 <strong>Default:</strong> None<br>
2954 <strong>Context:</strong> server config, <code>&lt;VirtualHost&gt;</code>, <code>&lt;Global&gt;</code><br>
2955 <strong>Module:</strong> mod_core<br>
2956 <strong>Compatibility:</strong> 1.3.1rc1 and later
2957
2958 <p>
2959 The <code>Trace</code> directive is used to configure which trace channels
2960 are logged to the <a href="#TraceLog"><code>TraceLog</code></a> file, and
2961 which log levels for messages in that trace channel.
2962
2963 <p>
2964 For example, to get the default trace channels logged:
2965 <pre>
2966 Trace DEFAULT:10
2967 </pre>
2968
2969 <p>
2970 To disable logging of a particular trace channel entirely, use a log level
2971 of zero, <i>e.g.</i>:
2972 <pre>
2973 # Log all of the default trace channels <b>except</b> for 'lock' and
2974 # 'scoreboard'
2975 Trace DEFAULT:10 lock:0 scoreboard:0
2976 </pre>
2977
2978 <p>
2979 To see only a certain range of log levels in a given trace channel, you
2980 can specify the log level range like this:
2981 <pre>
2982 # Log only messages at levels 7-10 for the default channels
2983 TraceLog DEFAULT:7-10
2984 </pre>
2985
2986 <p>
2987 See the <a href="../howto/Tracing.html">Tracing</a> howto for more information.
2988
2989 <p>
2990 <hr>
2991 <h3><a name="TraceLog">TraceLog</a></h3>
2992 <strong>Syntax:</strong> TraceLog <em>path</em><br>
2993 <strong>Default:</strong> None<br>
2994 <strong>Context:</strong> server config, <code>&lt;Global&gt;</code><br>
2995 <strong>Module:</strong> mod_core<br>
2996 <strong>Compatibility:</strong> 1.3.1rc1 and later
2997
2998 <p>
2999 The <code>TraceLog</code> directive is used to specify a log file for trace
3000 logging messages. The <em>path</em> parameter given must be the full path to
3001 the file to use for logging.
3002
3003 <p>
3004 Note that this path must <b>not</b> be to a world-writable directory and,
3005 unless <code>AllowLogSymlinks</code> is explicitly set to <em>on</em>
3006 (generally a bad idea), the path must <b>not</b> be a symbolic link.
3007
3008 <p>
3009 See the <a href="../howto/Tracing.html">Tracing</a> howto for more information.
3010
3011 <p>
3012 <hr>
3013 <h3><a name="TraceOptions">TraceOptions</a></h3>
3014 <strong>Syntax:</strong> TraceOptions <em>opt1 ... optN</em><br>
3015 <strong>Default:</strong> None<br>
3016 <strong>Context:</strong> server config, &lt;VirtualHost&gt;, &lt;Global&gt;<br>
3017 <strong>Module:</strong> mod_core<br>
3018 <strong>Compatibility:</strong> 1.3.4rc2 and later
3019
3020 <p>
3021 The <code>TraceOptions</code> directive can be used to change the format
3022 of the <a href="#TraceLog"><code>TraceLog</code></a> messages, <i>e.g.</i>
3023 adding/remove certain fields of data.
3024
3025 <p>
3026 The options supported by the <code>TraceOptions</code> directive are:
3027 <ul>
3028 <li>ConnIPs
3029 <li>Timestamp
3030 <li>TimestampMillis
3031 </ul>
3032 The <code>Timestamp</code> option is <em>enabled</em> by default; the others
3033 are <em>disabled</em> by default.
3034
3035 <p>
3036 To enable an option, preface the option name with a '+' (plus) character;
3037 to disable the option, use a '-' (minus) character prefix. For example:
3038 <pre>
3039 # Log timestamps inncluding millisecs, but do not include the connection
3040 # IP address/port information
3041 TraceOptions +TimestampMillis -ConnIPs
3042 </pre>
3043
3044 <p>
3045 <hr>
3046 <h3><a name="TransferLog">TransferLog</a></h3>
3047 <strong>Syntax:</strong> TransferLog <em>path</em>|"none"<br>
3048 <strong>Default:</strong> None<br>
3049 <strong>Context:</strong> server config;, &lt;VirtualHost&gt;, &lt;Global&gt;, &lt;Anonymous&gt;<br>
3050 <strong>Module:</strong> mod_core<br>
3051 <strong>Compatibility:</strong> 1.1.4 and later
3052
3053 <p>
3054 The <code>TransferLog</code> directive configures the full <em>path</em> to the
3055 "wu-ftpd style" file transfer log; see the <a href="../howto/Logging.html#TransferLog"><code>xferlog(5)</code></a> man page for a description of this log
3056 file format. Separate log files can be created for each
3057 <code>&lt;Anonymous&gt;</code> and/or <code>&lt;VirtualHost&gt;</code>.
3058 Additionally, the special keyword "none" (available in proftpd-1.1.7 and later)
3059 can be used, which disables wu-ftpd style transfer logging for the context in
3060 which the directive is used.
3061
3062 <p>
3063 See also: <a href="mod_log.html#ExtendedLog"><code>ExtendedLog</code></a>,
3064 <a href="mod_log.html#LogFormat"><code>LogFormat</code></a>
3065
3066 <p>
3067 <hr>
3068 <h3><a name="Umask">Umask</a></h3>
3069 <strong>Syntax:</strong> Umask <em>file-umask [dir-umask]</em><br>
3070 <strong>Default:</strong> None<br>
3071 <strong>Context:</strong> server config, &lt;VirtualHost&gt;, &lt;Global&gt;, &lt;Anonymous&gt;, .ftpaccess<br>
3072 <strong>Module:</strong> mod_core<br>
3073 <strong>Compatibility:</strong> 0.99.0 and later
3074
3075 <p>
3076 The <code>Umask</code> directive sets the mask applied to newly created file
3077 and directory permissions. Any parameters supplied must be an octal number,
3078 in the format <code>0<i>xxx</i></code>.
3079
3080 <p>
3081 An optional second <em>dir-umask</em> parameter can specify a different
3082 <code>Umask</code> to be used when creating directories, rather than files.
3083 If this second parameter is not used, directories are created using the
3084 <em>file-umask</em> value from the first parameter. For more information on
3085 umasks, consult your operating system documentation/man pages.
3086
3087 <p>
3088 <b>Note</b>: ProFTPD will <b>not</b> create files that have the executable bit
3089 enabled; this is a security-driven design decision. The permissions of an
3090 uploaded file can be changed by issuing a <code>SITE CHMOD</code> command,
3091 <i>e.g.</i>:
3092 <pre>
3093 SITE CHMOD 0755 /path/to/uploaded/file
3094 </pre>
3095
3096 <p>
3097 The <code>Umask</code> <a href="../howto/Umask.html">howto</a> also talks about
3098 umasks in greater detail.
3099
3100 <p>
3101 <hr>
3102 <h3><a name="UnsetEnv">UnsetEnv</a></h3>
3103 <strong>Syntax:</strong> UnsetEnv <em>name</em><br>
3104 <strong>Default:</strong> None<br>
3105 <strong>Context:</strong> server config, <code>&lt;Virtual&gt;</code>, <code>&lt;Global&gt;</code><br>
3106 <strong>Module:</strong> mod_core<br>
3107 <strong>Compatibility:</strong> 1.2.10rc1 and later
3108
3109 <p>
3110 The <code>UnsetEnv</code> directive is used to unset/remove the <em>name</em>
3111 environment variable from the environment for sessions. Note that if the
3112 <code>UnsetEnv</code> directive is used in the &quot;server config&quot;
3113 configuration context, the <em>name</em> variable is removed from the
3114 environment for the ProFTPD daemon process as well.
3115
3116 <p>
3117 Examples:
3118 <pre>
3119 # Unset the USER and HOME environment variables for sessions
3120 UnsetEnv USER
3121 UnsetEnv HOME
3122 </pre>
3123
3124 <p>
3125 See also: <a href="#SetEnv"><code>SetEnv</code></a>
3126
3127 <p>
3128 <hr>
3129 <h3><a name="UseIPv6">UseIPv6</a></h3>
3130 <strong>Syntax:</strong> UseIPv6 <em>on|off</em><br>
3131 <strong>Default:</strong> UseIPv6 on<br>
3132 <strong>Context:</strong> server config<br>
3133 <strong>Module:</strong> mod_core<br>
3134 <strong>Compatibility:</strong> 1.3.1rc1 and later
3135
3136 <p>
3137 The <code>UseIPv6</code> directive enables/disables the use of IPv6.
3138
3139 <p>
3140 IPv6 support can also be controlled via command-line options:
3141 <ul>
3142 <li><em><code>-4</code>, <code>--ipv4</code></em><br>
3143 <p>
3144 Use/support IPv4 functionality only
3145 </li>
3146
3147 <p>
3148 <li><em><code>-6</code>, <code>--ipv6</code></em><br>
3149 <p>
3150 Use/support IPv4 <b>and</b> IPv6 functionality
3151 </li>
3152 </ul>
3153
3154 <p>
3155 <hr>
3156 <h3><a name="User">User</a></h3>
3157 <strong>Syntax:</strong> User <em>name</em><br>
3158 <strong>Default:</strong> None<br>
3159 <strong>Context:</strong> server config, &lt;VirtualHost&gt;, &lt;Global&gt;, &lt;Anonymous&gt;<br>
3160 <strong>Module:</strong> mod_core<br>
3161 <strong>Compatibility:</strong> 0.99.0 and later
3162
3163 <p>
3164 The <code>User</code> directive configures the UID that ProFTPD will use when
3165 running.
3166
3167 <p>
3168 By default, ProFTPD runs as &quot;root&quot;; this is considered undesirable in
3169 all but the most trusted network configurations. The <code>User</code>
3170 directive, used in conjunction with the <a href="#Group"><code>Group</code></a>
3171 directive, instructs ProFTPD to switch to the specified UID/GID as quickly as
3172 possible after startup.
3173
3174 <p>
3175 On some Unix variants, ProFTPD will occasionally switch back to &quot;root&quot;
3176 in order to accomplish a task which requires superuser access. Once that task
3177 is completed, root privileges are relinquished and the server returns to running
3178 as the specified UID/GID. When applied to a <code>&lt;VirtualHost&gt;</code>
3179 section, ProFTPD will run as the specified UID/GID on connections destined for
3180 the virtual server's address and port. If either <code>User</code> or
3181 <code>Group</code> is applied to an <code>&lt;Anonymous&gt;</code> section,
3182 ProFTPD will establish an anonymous login when a client attempts to authenticate
3183 with that specified <code>User</code> name, as well as permanently switching to
3184 the corresponding UID/GID after authentication.
3185
3186 <p>
3187 <hr>
3188 <h3><a name="UseReverseDNS">UseReverseDNS</a></h3>
3189 <strong>Syntax:</strong> UseReverseDNS <em>on|off</em><br>
3190 <strong>Default:</strong> UseReverseDNS on<br>
3191 <strong>Context:</strong> server config<br>
3192 <strong>Module:</strong> mod_core<br>
3193 <strong>Compatibility:</strong> 1.1.7 and later
3194
3195 <p>
3196 The <code>UseReverseDNS</code> directive is used to control whether ProFTPD
3197 performs a <a href="https://en.wikipedia.org/wiki/Reverse_DNS_lookup">reverse
3198 DNS lookup</a> on connecting clients, both for control <i>and</i> for data
3199 connections. When reverse DNS lookups are enabled, the
3200 <a href="mod_log.html#LogFormat"><code>LogFormat %h</code></a> variable will
3201 use the IP address, rather than the remote hostname.
3202
3203 <p>
3204 Normally, <i>incoming</i> active mode data connections and <i>outgoing</i>
3205 passive mode data connections have reverse DNS lookups performed on the remote
3206 host's IP address. However, when the session is chrooted (<i>e.g.</i> due to
3207 the <a href="mod_auth.html#DefaultRoot"><code>DefaultRoot</code></a> directive
3208 or an <code>&lt;Anonymous&gt;</code> login), the local <code>/etc/hosts</code>
3209 file cannot be checked, and the only possible resolution is via DNS. If for
3210 some reason, DNS is not available or improperly configured <i>for that
3211 remote host</i>, this can result in ProFTPD blocking/stalling <i>until</i> the
3212 DNS resolution times out.
3213
3214 <p>
3215 <b>Note</b> that using:
3216 <pre>
3217 UseReverseDNS on
3218 </pre>
3219 <i>can</i> lead to delays when connecting to ProFTPD, due to the time needed
3220 to perform the forward <i>and</i> reverse DNS resolutions.
3221
3222 <p>
3223 <hr>
3224 <h3><a name="UserOwner">UserOwner</a></h3>
3225 <strong>Syntax:</strong> UserOwner <em>user-name</em><br>
3226 <strong>Default:</strong> None<br>
3227 <strong>Context:</strong> &lt;Anonymous&gt;, &lt;Directory&gt;<br>
3228 <strong>Module:</strong> mod_core<br>
3229 <strong>Compatibility:</strong> 1.2pre11 and later
3230
3231 <p>
3232 The <code>UserOwner</code> directive is used to specify the <em>user-name</em>
3233 which will own all created files and directories within the
3234 <code>&lt;Anonymous&gt;</code> or <code>&lt;Directory&gt;</code> section
3235 contain the <code>UserOwner</code> directive; the default behavior is that
3236 all created files/directories will be owned by the logged-in user, of course.
3237
3238 <p>
3239 When the <code>UserOwner</code> directive is used, the
3240 <code>GroupOwner</code> directive is <b>not</b> restricted to groups to which
3241 the logged-in user belongs.
3242
3243 <p>
3244 See also: <a href="#GroupOwner"><code>GroupOwner</code></a>
3245
3246 <p>
3247 <hr>
3248 <h3><a name="VirtualHost">&lt;VirtualHost&gt;</a></h3>
3249 <strong>Syntax:</strong> &lt;VirtualHost <em>ip-address|dns-name [ip-address|dns-name ...]</em>&gt;<br>
3250 <strong>Default:</strong> None<br>
3251 <strong>Context:</strong> server config<br>
3252 <strong>Module:</strong> mod_core<br>
3253 <strong>Compatibility:</strong> 0.99.0 and later
3254
3255 <p>
3256 The <code>&lt;VirtualHost&gt;</code> configuration section is used to create
3257 an independent set of configuration directives that apply to a <i>particular
3258 hostname or IP address</i>. It is often used in conjunction with system level
3259 IP aliasing or dummy network interfaces in order to establish one or more
3260 <em>virtual</em> servers which all run on the same physical machine. The
3261 section is terminated with a <code>&lt;/VirtualHost&gt;</code> directive.
3262
3263 <p>
3264 By using the <a href="#Port"><code>Port</code></a> directive inside a
3265 <code>&lt;VirtualHost&gt;</code> section, it is possible to create a virtual
3266 server which uses the same IP address as the master server, <i>but</i>
3267 which listens on a <em>different</em> TCP port (Note, however, that this
3268 approach is incompatible with a
3269 <a href="#ServerType"><code>ServerType</code></a> of "inetd").
3270
3271 <p>
3272 When <code>proftpd</code> starts up, virtual server connections are handled in
3273 one of two ways, depending on the
3274 <a href="#ServerType"><code>ServerType</code></a> setting:
3275 <ul>
3276 <li><em>inetd</em>
3277 <p>
3278 The daemon examines the destination address and port of the incoming
3279 connection being handed off from <code>inetd/xinetd</code>. If the
3280 connection matches one of the configured <code>&lt;VirtualHost&gt;</code>
3281 sections, the connection is handled by that matching configuration. If no
3282 <code>&lt;VirtualHost&gt;</code> section matches, and the main server does
3283 not match, the client is informed that no server is available to handle
3284 their requests, and the client is disconnected.
3285 </li>
3286
3287 <p>
3288 <li><em>standalone</em>
3289 <p>
3290 After parsing the configuration file, the daemon begins listening for
3291 connections on all configured ports, spawning child processes as necessary
3292 to handle connections for either the main server or any
3293 <code>&lt;VirtualHost&gt;</code> sections.
3294
3295 <p>
3296 Because of the method that the daemon uses to listen for connections when
3297 in standalone mode, it is possible to support an exceedingly large number
3298 of virtual servers, potentially exceeding the number of per-process file
3299 descriptors. This is due to the fact that a single file descriptor is used
3300 to listen to each configured port, regardless of the number of addresses
3301 being monitored. Note that it may be necessary to increase the
3302 <a href="#TCPBacklog"><code>TCPBackLog</code></a> value on heavily loaded
3303 servers in order to avoid kernel-rejected client connections; clients
3304 will receive a "Connection refused" error when this condition happens.
3305 </li>
3306 </ul>
3307
3308 <p>
3309 Starting with <code>proftpd-1.3.0rc1</code>, it is possible to use more than
3310 one DNS name or IP address. And starting with <code>proftpd-1.3.5rc1</code>,
3311 a device/interface name can also be used.
3312
3313 <p>
3314 Examples:
3315 <pre>
3316 &lt;VirtualHost host1.domain.com host2.domain.com&gt;
3317 ...
3318 &lt;/VirtualHost&gt;
3319
3320 # Establish a virtual server for the eth1 interface
3321 &lt;VirtualHost eth1&gt;
3322 ...
3323 &lt;/VirtualHost&gt;
3324
3325 </pre>
3326 The virtual server <a href="../howto/Vhost.html">howto</a> also talks about
3327 virtual servers in greater detail.
3328
3329 <p>
3330 See also: <a href="#DefaultAddress"><code>DefaultAddress</code></a>
3331
3332 <p>
3333 <hr>
3334 <h2><a name="Installation">Installation</a></h2>
3335 The <code>mod_core</code> module is <b>always</b> installed.
3336
3337 <p><a name="FAQ">
3338 <hr>
3339 <b>Frequently Asked Questions</b><br>
3340
3341 <p><a name="ListenOnOneAddressOnly">
3342 <font color=red>Question</font>: How do I configure <code>proftpd</code> to
3343 only listen to connections on one address, <i>e.g.</i> 127.0.0.1? If I use
3344 the following in my <code>proftpd.conf</code>:
3345 <pre>
3346 DefaultAddress localhost
3347 </pre>
3348 I am still able to connect to <code>proftpd</code> from another machine.<br>
3349 <font color=blue>Answer</font>: The solution is to use the
3350 <a href="#SocketBindTight"><code>SocketBindTight</code></a>, like this:
3351 <pre>
3352 DefaultAddress localhost
3353 SocketBindTight on
3354 </pre>
3355 The <code>SocketBindTight</code> directive tells <code>proftpd</code> to
3356 listen <b>only</b> on that 'localhost' IP address, rather than on all
3357 addresses.
3358
3359 <p><a name="FileZillaNonASCII">
3360 <font color=red>Question</font>: When I connect to ProFTPD using FileZilla,
3361 I see FileZilla log the following warning:
3362 <pre>
3363 Status: Server does not support non-ASCII characters.
3364 </pre>
3365 even though I used the <code>--enable-nls</code> build option, and my ProFTPD
3366 supports UTF8. What is wrong?<br>
3367 <font color=blue>Answer</font>: FileZilla parses the <code>FEAT</code> response
3368 to determine whether the FTP server supports the UTF-8 encoding. However, the
3369 <i>format</i> of the <code>FEAT</code> response can confuse FileZilla's
3370 detection code. For example, if your <code>proftpd.conf</code> uses
3371 the deprecated <code>MultilineRFC2228</code> directive:
3372 <pre>
3373 # This directive is deprecated, and should be removed
3374 MultilineRFC2228 on
3375 </pre>
3376 this causes ProFTPD's <code>FEAT</code> response format to be different than
3377 FileZilla expects, which can lead to the above "does not support non-ASCII
3378 characters" message.
3379
3380 <p>
3381 The solution is to use remove use of the deprecated
3382 <code>MultilineRFC2228</code> directive in your <code>proftpd.conf</code>
3383 (or simply remove that directive entirely).
3384
3385 <p>
3386 <hr>
3387 <font size=2><b><i>
3388 &copy; Copyright 2000-2023 The ProFTPD Project<br>
3389 All Rights Reserved<br>
3390 </i></b></font>
3391 <hr>
3392
3393 </body>
3394 </html>