| 1 | <!DOCTYPE html> |
| 2 | <html> |
| 3 | <head> |
| 4 | <title>ProFTPD module mod_ctrls_admin</title> |
| 5 | </head> |
| 6 | |
| 7 | <body bgcolor=white> |
| 8 | |
| 9 | <hr> |
| 10 | <center> |
| 11 | <h2><b>ProFTPD module <code>mod_ctrls_admin</code></b></h2> |
| 12 | </center> |
| 13 | <hr><br> |
| 14 | |
| 15 | This module is contained in the <code>mod_ctrls_admin.c</code> file for |
| 16 | ProFTPD /1.3.<i>x</i>, and is not compiled by default. Installation |
| 17 | instructions are discussed <a href="#Installation">here</a>. |
| 18 | |
| 19 | <p> |
| 20 | This module implements administrative control actions for the |
| 21 | <code>ftpdctl</code> program. |
| 22 | |
| 23 | <p> |
| 24 | The most current version of <code>mod_ctrls_admin</code> is distributed with |
| 25 | the ProFTPD source. |
| 26 | |
| 27 | <h2>Author</h2> |
| 28 | <p> |
| 29 | Please contact TJ Saunders <tj <i>at</i> castaglia.org> with any |
| 30 | questions, concerns, or suggestions regarding this module. |
| 31 | |
| 32 | <h2>Directives</h2> |
| 33 | <ul> |
| 34 | <li><a href="#AdminControlsACLs">AdminControlsACLs</a> |
| 35 | <li><a href="#AdminControlsEngine">AdminControlsEngine</a> |
| 36 | </ul> |
| 37 | |
| 38 | <h2>Control Actions</h2> |
| 39 | <ul> |
| 40 | <li><a href="#config"><code>config</code></a> |
| 41 | <li><a href="#debug"><code>debug</code></a> |
| 42 | <li><a href="#dns"><code>dns</code></a> |
| 43 | <li><a href="#down"><code>down</code></a> |
| 44 | <li><a href="#get"><code>get</code></a> |
| 45 | <li><a href="#kick"><code>kick</code></a> |
| 46 | <li><a href="#restart"><code>restart</code></a> |
| 47 | <li><a href="#scoreboard"><code>scoreboard</code></a> |
| 48 | <li><a href="#shutdown"><code>shutdown</code></a> |
| 49 | <li><a href="#status"><code>status</code></a> |
| 50 | <li><a href="#trace"><code>trace</code></a> |
| 51 | <li><a href="#up"><code>up</code></a> |
| 52 | </ul> |
| 53 | |
| 54 | <p> |
| 55 | <hr> |
| 56 | <h1>Directives</h1> |
| 57 | |
| 58 | <p> |
| 59 | <hr> |
| 60 | <h3><a name="AdminControlsACLs">AdminControlsACLs</a></h3> |
| 61 | <strong>Syntax:</strong> AdminControlsACLs <em>actions|all allow|deny user|group list</em><br> |
| 62 | <strong>Default:</strong> None<br> |
| 63 | <strong>Context:</strong> server config<br> |
| 64 | <strong>Module:</strong> mod_ctrls_admin<br> |
| 65 | <strong>Compatibility:</strong> 1.2.10rc1 and later |
| 66 | |
| 67 | <p> |
| 68 | The <code>AdminControlsACLs</code> directive configures access lists of |
| 69 | <em>users</em> or <em>groups</em> who are allowed (or denied) the ability to |
| 70 | use the <em>actions</em> implemented by <code>mod_ctrls_admin</code>. The |
| 71 | default behavior is to deny everyone unless an ACL allowing access has been |
| 72 | explicitly configured. |
| 73 | |
| 74 | <p> |
| 75 | If "allow" is used, then <em>list</em>, a comma-delimited list |
| 76 | of <em>users</em> or <em>groups</em>, can use the given <em>actions</em>; all |
| 77 | others are denied. If "deny" is used, then the <em>list</em> of |
| 78 | <em>users</em> or <em>groups</em> cannot use <em>actions</em> all others are |
| 79 | allowed. Multiple <code>AdminControlsACLs</code> directives may be used to |
| 80 | configure ACLs for different control actions, and for both users and groups. |
| 81 | |
| 82 | <p> |
| 83 | <hr> |
| 84 | <h3><a name="AdminControlsEngine">AdminControlsEngine</a></h3> |
| 85 | <strong>Syntax:</strong> AdminControlsEngine <em>on|off|actions</em><br> |
| 86 | <strong>Default:</strong> None<br> |
| 87 | <strong>Context:</strong> server config<br> |
| 88 | <strong>Module:</strong> mod_ctrls_admin<br> |
| 89 | <strong>Compatibility:</strong> 1.2.10rc1 and later |
| 90 | |
| 91 | <p> |
| 92 | The <code>AdminControlsEngine</code>directive enables or disables the |
| 93 | <code>mod_ctrls_admin</code> module, and thus the handling of its |
| 94 | implemented control actions. |
| 95 | |
| 96 | <p> |
| 97 | If only certain of the module's control actions are wanted, provide a list |
| 98 | of those <em>actions</em>, rather than the normal "on" or |
| 99 | "off". Any of <code>mod_ctrls_admin</code>'s control actions that |
| 100 | do not appear in <em>actions</em> will be unregistered; by default, all of |
| 101 | the module's control actions are registered. |
| 102 | |
| 103 | <p> |
| 104 | <hr> |
| 105 | <h1>Control Actions</h1> |
| 106 | |
| 107 | <p> |
| 108 | <hr> |
| 109 | <h3><a name="config"><code>config</code></a></h3> |
| 110 | <strong>Syntax:</strong> ftpdctl config set|remove <em>ip-address|dns-name[:port] directive ...</em><br> |
| 111 | <strong>Purpose:</strong> Update configuration of a virtual server |
| 112 | |
| 113 | <p> |
| 114 | The <code>config</code> control action can be used to update the configuration |
| 115 | of an individual virtual server, without requiring a <code>SIGHUP</code> |
| 116 | to restart the daemin and reparse the configuration. The <code>config</code> |
| 117 | action supports two subcommands: "set" and "remove". |
| 118 | |
| 119 | <p> |
| 120 | Both <code>config</code> subcommands take the address of the virtual server |
| 121 | whose configuration is to be changed. This can be specified as a DNS name |
| 122 | or an IP address, and optionally the port number. If no port number is |
| 123 | explicitly provided, a default of port 21 is assumed. IPv6 addresses <b>are</b> |
| 124 | supported. Examples: |
| 125 | <pre> |
| 126 | $ ftpdctl config set 10.1.2.3 ... |
| 127 | $ ftpdctl config set ftp.example.com:2121 ... |
| 128 | $ ftpdctl config set '[::1]:4242' ... |
| 129 | </pre> |
| 130 | <b>Note</b> that using the IPv6 syntax may require that you enclose the |
| 131 | address in single quotes, to prevent the shell from parsing those characters. |
| 132 | |
| 133 | <p> |
| 134 | When <i>setting</i> a configuration directive, all of the parameters of that |
| 135 | configuration directive are required, just as if you were typing that |
| 136 | configuration directive in the config file: |
| 137 | <pre> |
| 138 | $ ftpdctl config set 192.168.0.101:2121 TLSRequired off |
| 139 | ftpdctl: config set: TLSRequired configured |
| 140 | </pre> |
| 141 | |
| 142 | <p> |
| 143 | When <i>removing</i> a configuration directive, only the configuration directive |
| 144 | name is needed: |
| 145 | <pre> |
| 146 | $ ftpdctl config remove 192.168.0.101 TLSRequired |
| 147 | ftpdctl: config remove: TLSRequired removed |
| 148 | </pre> |
| 149 | |
| 150 | <p> |
| 151 | <hr> |
| 152 | <h3><a name="debug"><code>debug</code></a></h3> |
| 153 | <strong>Syntax:</strong> ftpdctl debug <em>[level [number]]|memory|config</em><br> |
| 154 | <strong>Purpose:</strong> Obtain debug information from the running daemon |
| 155 | |
| 156 | <p> |
| 157 | Obtaining debug output from the server greatly helps in diagnosing problems. |
| 158 | The trick is in getting this debug output from the server. The |
| 159 | <code>debug</code> control action can be used to gather such information. |
| 160 | |
| 161 | <p> |
| 162 | First, this control action can increase or query the debug logging verbosity |
| 163 | of the daemon on-the-fly, to obtain the needed output, and then to return the |
| 164 | daemon to a more silent state of logging. |
| 165 | |
| 166 | <p> |
| 167 | Example: |
| 168 | <pre> |
| 169 | $ ftpdctl debug level 9 |
| 170 | </pre> |
| 171 | raises the verbosity of the daemon to its maximum level. Once enough output |
| 172 | has been collected, use: |
| 173 | <pre> |
| 174 | $ ftpdctl debug level 0 |
| 175 | </pre> |
| 176 | to return the daemon to its default debug output level. |
| 177 | |
| 178 | <p> |
| 179 | Instead, to simply check the current debug logging verbosity, use: |
| 180 | <pre> |
| 181 | $ ftpdctl debug level |
| 182 | </pre> |
| 183 | |
| 184 | <p> |
| 185 | Alternatively, for developers (<i>i.e.</i> if <code>proftpd</code> was |
| 186 | compiled with the <code>--enable-devel</code> configure option), this control |
| 187 | action can be used to display the current memory allocation of the daemon: |
| 188 | <pre> |
| 189 | $ ftpdctl debug memory |
| 190 | </pre> |
| 191 | Memory allocations for session processes are currently not available via |
| 192 | this control action. |
| 193 | |
| 194 | <p> |
| 195 | <hr> |
| 196 | <h3><a name="dns"><code>dns</code></a></h3> |
| 197 | <strong>Syntax:</strong> ftpdctl dns <em>on|off</em><br> |
| 198 | <strong>Purpose:</strong> DNS configuration |
| 199 | |
| 200 | <p> |
| 201 | The <code>dns</code> control action can be used to enable or disable |
| 202 | the <code>UseReverseDNS</code> configuration at run time: |
| 203 | <pre> |
| 204 | # Enable resolution of IP addresses to DNS names |
| 205 | $ ftpdctl dns on |
| 206 | |
| 207 | # Disable resolution of IP addresses to DNS names |
| 208 | $ ftpdctl dns off |
| 209 | </pre> |
| 210 | |
| 211 | <p> |
| 212 | Note that the <code>dns</code> control action also supports a command for |
| 213 | clearing any cached DNS lookup information: |
| 214 | <pre> |
| 215 | $ ftpdctl dns clear cache |
| 216 | </pre> |
| 217 | |
| 218 | <p> |
| 219 | <hr> |
| 220 | <h3><a name="down"><code>down</code></a></h3> |
| 221 | <strong>Syntax:</strong> ftpdctl down <em>ip-address|dns-name[#port]|"all"</em><br> |
| 222 | <strong>Purpose:</strong> Turn down a virtual server |
| 223 | |
| 224 | <p> |
| 225 | The <code>down</code> control action can be used to "turn down" |
| 226 | an individual virtual server, so that clients cannot connect to it. Once |
| 227 | a virtual server has been "downed", the |
| 228 | "<a href="#up">up</a>" control action can be used to bring |
| 229 | that virtual server back up. |
| 230 | |
| 231 | <p> |
| 232 | If a port number is not specified, it defaults to 21. |
| 233 | |
| 234 | <p> |
| 235 | Note that using "down all" effectively puts the daemon in an |
| 236 | "administrative" shutdown state, where the daemon is still running |
| 237 | but no servers are available for servicing incoming connection requests. |
| 238 | Current sessions are not affected. |
| 239 | |
| 240 | <p> |
| 241 | <hr> |
| 242 | <h3><a name="get"><code>get</code></a></h3> |
| 243 | <strong>Syntax:</strong> ftpdctl get <em>"config"|"directives"</em><br> |
| 244 | <strong>Purpose:</strong> Obtain configuration information |
| 245 | |
| 246 | <p> |
| 247 | The <code>get</code> control action can be used obtain various sorts of |
| 248 | configuration information from the daemon. At present, this control action |
| 249 | only supports the "config" and "directives" parameters. |
| 250 | |
| 251 | <p> |
| 252 | The "config" parameter causes <code>ftpdctl</code> to display |
| 253 | a configuration dump, similar to what is displayed by a syntax check |
| 254 | (<i>i.e.</i> using the <code>-t</code> proftpd command-line option). |
| 255 | |
| 256 | <p> |
| 257 | The "directives" parameter causes <code>ftpdctl</code> to display a |
| 258 | sorted list of all supported configuration directives, as well as the module |
| 259 | which handles the corresponding directive. |
| 260 | |
| 261 | <p> |
| 262 | <hr> |
| 263 | <h3><a name="kick"><code>kick</code></a></h3> |
| 264 | <strong>Syntax:</strong> ftpdctl kick <em>[class name]|[host dns-name|ip-address][user name]</em><br> |
| 265 | <strong>Purpose:</strong> Kick a currently connected class, host or user from the daemon |
| 266 | |
| 267 | <p> |
| 268 | The <code>kick</code> control action can be used to disconnect a currently |
| 269 | connected <em>class</em>, <em>host</em> or <em>user</em> from the daemon. |
| 270 | |
| 271 | <p> |
| 272 | Examples: |
| 273 | <pre> |
| 274 | $ ftpdctl kick user bob dave |
| 275 | </pre> |
| 276 | will kick all sessions that have logged in as user "bob" or user "dave". |
| 277 | <pre> |
| 278 | $ ftpdctl kick host luser.host.net |
| 279 | </pre> |
| 280 | will kick all sessions that have connected from host "luser.host.net". |
| 281 | <pre> |
| 282 | $ ftpdctl kick class eval intranet |
| 283 | </pre> |
| 284 | will kick all sessions that belong to classes "eval" and "intranet". |
| 285 | |
| 286 | <p> |
| 287 | You can also use the <code>-n <count></code> command-line option to |
| 288 | specify the maximum number of clients to be kicked. For example, perhaps |
| 289 | you only want to kick off 10 clients from host "luser.host.net" |
| 290 | rather than kicking all of them off. To do this, use: |
| 291 | <pre> |
| 292 | $ ftpdctl kick host -n 10 luser.host.net |
| 293 | </pre> |
| 294 | |
| 295 | <p> |
| 296 | <hr> |
| 297 | <h3><a name="restart"><code>restart</code></a></h3> |
| 298 | <strong>Syntax:</strong> ftpdctl restart<br> |
| 299 | <strong>Purpose:</strong> Restart the daemon |
| 300 | |
| 301 | <p> |
| 302 | The <code>restart</code> control action causes the daemon to re-read its |
| 303 | configuration file, just as if a <code>SIGHUP</code> had been used. This is |
| 304 | convenient for administrators, as it does not (necessarily) require root |
| 305 | privileges, nor knowledge of the daemon's PID, to restart the daemon. |
| 306 | |
| 307 | <p> |
| 308 | Example: |
| 309 | <pre> |
| 310 | $ ftpdctl restart |
| 311 | </pre> |
| 312 | In addition, you can use the <code>restart</code> control to ask the daemon |
| 313 | how many times it has been restarted: |
| 314 | <pre> |
| 315 | $ ftpdctl restart count |
| 316 | ftpdctl: restarted 4 times since 2010-01-06 23:20:09 GMT |
| 317 | </pre> |
| 318 | |
| 319 | <p> |
| 320 | <hr> |
| 321 | <h3><a name="scoreboard"><code>scoreboard</code></a></h3> |
| 322 | <strong>Syntax:</strong> ftpdctl scoreboard scrub<br> |
| 323 | <strong>Purpose:</strong> Scrubs the ScoreboardFile for dead processes |
| 324 | |
| 325 | <p> |
| 326 | The <code>scoreboard</code> control action can be used to force the |
| 327 | <code>ScoreboardFile</code> to be "scrubbed" for dead session |
| 328 | processes which may not have exited cleanly. |
| 329 | <pre> |
| 330 | $ ftpdctl scoreboard scrub |
| 331 | |
| 332 | # The verb "clean" is synonymous with "scrub" |
| 333 | $ ftpdctl scoreboard clean |
| 334 | </pre> |
| 335 | |
| 336 | <p> |
| 337 | <hr> |
| 338 | <h3><a name="shutdown"><code>shutdown</code></a></h3> |
| 339 | <strong>Syntax:</strong> ftpdctl shutdown <em>["graceful" seconds]</em><br> |
| 340 | <strong>Purpose:</strong> Stop the daemon |
| 341 | |
| 342 | <p> |
| 343 | The <code>shutdown</code> control action shuts the daemon down. This is |
| 344 | convenient for administrators, as it does not (necessarily) require root |
| 345 | privileges, nor knowledge of the daemon's PID, to stop the daemon. |
| 346 | |
| 347 | <p> |
| 348 | The optional "graceful" parameter allows for a graceful shutdown, |
| 349 | in which <code>proftpd</code> will wait for the given number of <em>seconds</em> |
| 350 | for all current sessions to end, before shutting down. |
| 351 | |
| 352 | <p> |
| 353 | Example: |
| 354 | <pre> |
| 355 | $ ftpdctl shutdown graceful 30 |
| 356 | </pre> |
| 357 | will cause <code>proftpd</code> to wait for 30 seconds for all current |
| 358 | sessions to end before shutting down completely. |
| 359 | |
| 360 | <p> |
| 361 | <hr> |
| 362 | <h3><a name="status"><code>status</code></a></h3> |
| 363 | <strong>Syntax:</strong> ftpdctl status <em>ip-address|dns-name[#port]|"all"</em><br> |
| 364 | <strong>Purpose:</strong> Display the status of virtual servers |
| 365 | |
| 366 | <p> |
| 367 | The <code>status</code> control action can be used to show the status of |
| 368 | a particular virtual server, whether it is <b>up</b> or <b>down</b>. |
| 369 | |
| 370 | <p> |
| 371 | If a port number is not specified, it defaults to 21. |
| 372 | |
| 373 | <p> |
| 374 | If "status all" is used, the status of all virtual servers will be |
| 375 | displayed. |
| 376 | |
| 377 | <p> |
| 378 | <hr> |
| 379 | <h3><a name="trace"><code>trace</code></a></h3> |
| 380 | <strong>Syntax:</strong> ftpdctl trace <em>channel:level|"info"</em><br> |
| 381 | <strong>Purpose:</strong> Configure trace channel log levels |
| 382 | |
| 383 | <p> |
| 384 | The <code>trace</code> control action can be used to dynamically change |
| 385 | the log levels of trace log levels. |
| 386 | |
| 387 | <p> |
| 388 | Example: |
| 389 | <pre> |
| 390 | $ ftpdctl trace delay:10 |
| 391 | </pre> |
| 392 | will set the log verbosity level of the <em>delay</em> trace log channel to 10. |
| 393 | |
| 394 | <p> |
| 395 | Additionally, the <code>trace</code> control action can be used to display |
| 396 | the list of current trace channels and their log levels, <i>e.g.</i>: |
| 397 | <pre> |
| 398 | $ ftpdctl trace info |
| 399 | ftpdctl: Channel Level |
| 400 | ftpdctl: ---------- ------ |
| 401 | ftpdctl: pam 10 |
| 402 | ftpdctl: netacl 10 |
| 403 | ftpdctl: response 10 |
| 404 | ftpdctl: auth 10 |
| 405 | ftpdctl: utf8 10 |
| 406 | ftpdctl: inet 10 |
| 407 | ftpdctl: binding 10 |
| 408 | ftpdctl: dns 10 |
| 409 | ftpdctl: dso 10 |
| 410 | ftpdctl: parser 10 |
| 411 | ftpdctl: pool 10 |
| 412 | ftpdctl: ctrls 10 |
| 413 | ftpdctl: data 10 |
| 414 | ftpdctl: netio 10 |
| 415 | ftpdctl: config 10 |
| 416 | ftpdctl: ident 10 |
| 417 | ftpdctl: command 10 |
| 418 | ftpdctl: delay 10 |
| 419 | ftpdctl: timer 10 |
| 420 | ftpdctl: var 10 |
| 421 | ftpdctl: event 10 |
| 422 | ftpdctl: fsio 10 |
| 423 | ftpdctl: site 10 |
| 424 | </pre> |
| 425 | |
| 426 | <p> |
| 427 | <hr> |
| 428 | <h3><a name="up"><code>up</code></a></h3> |
| 429 | <strong>Syntax:</strong> ftpdctl up <em>ip-address|dns-name[#port]</em><br> |
| 430 | <strong>Purpose:</strong> Turn up a "downed" virtual server |
| 431 | |
| 432 | <p> |
| 433 | The <code>up</code> control action can be used to "turn up" |
| 434 | any virtual server that has been "downed" by the |
| 435 | "<a href="#down">down</a>" control action. Note that using the |
| 436 | "<a href="#restart">restart</a>" control action is sufficient to |
| 437 | enable, with one command, all virtual servers that have been downed. |
| 438 | |
| 439 | <p> |
| 440 | If a port number is not specified, it defaults to 21. |
| 441 | |
| 442 | <p> |
| 443 | <hr> |
| 444 | <h2><a name="Installation">Installation</a></h2> |
| 445 | This module requires that controls support be enabled in <code>proftpd</code> |
| 446 | via the <code>--enable-ctrls</code> configure option. Follow the normal |
| 447 | steps for using third-party modules in ProFTPD: |
| 448 | <pre> |
| 449 | $ ./configure --enable-ctrls --with-modules=mod_ctrls_admin |
| 450 | </pre> |
| 451 | To build <code>mod_ctrls_admin</code> as a DSO module: |
| 452 | <pre> |
| 453 | $ ./configure --enable-ctrls --enable-dso --with-shared=mod_ctrls_admin |
| 454 | </pre> |
| 455 | Then follow the usual steps: |
| 456 | <pre> |
| 457 | $ make |
| 458 | $ make install |
| 459 | </pre> |
| 460 | |
| 461 | <p> |
| 462 | For those with an existing ProFTPD installation, you can use the |
| 463 | <code>prxs</code> tool to add <code>mod_ctrls_admin</code>, as a DSO module, to |
| 464 | your existing server: |
| 465 | <pre> |
| 466 | $ prxs -c -i -d mod_ctrls_admin.c |
| 467 | </pre> |
| 468 | |
| 469 | <p> |
| 470 | <hr> |
| 471 | <font size=2><b><i> |
| 472 | © Copyright 2004-2016 The ProFTPD Project<br> |
| 473 | All Rights Reserved<br> |
| 474 | </i></b></font> |
| 475 | <hr> |
| 476 | |
| 477 | </body> |
| 478 | </html> |