| 1 | <!DOCTYPE html> |
| 2 | <html> |
| 3 | <head> |
| 4 | <title>ProFTPD module mod_ctrls</title> |
| 5 | </head> |
| 6 | |
| 7 | <body bgcolor=white> |
| 8 | |
| 9 | <hr> |
| 10 | <center> |
| 11 | <h2><b>ProFTPD module <code>mod_ctrls</code></b></h2> |
| 12 | </center> |
| 13 | <hr><br> |
| 14 | |
| 15 | <p> |
| 16 | This module is contained in the <code>mod_ctrls.c</code> and |
| 17 | <code>mod_ctrls.h</code> files for ProFTPD 1.2, and is not compiled by default. |
| 18 | Installation instructions are discussed <a href="#Installation">here</a>. |
| 19 | |
| 20 | <p> |
| 21 | This module implements the server side of a Unix domain socket, used for |
| 22 | communication with a running <code>proftpd</code> daemon. The client used for |
| 23 | this communication is <code>ftpdctl</code>, part of the Controls API. |
| 24 | See the <code>ftpdctl</code> man page for details on using that program; |
| 25 | details on the <a href="#Usage">usage</a> of this module follow |
| 26 | the directive descriptions. |
| 27 | |
| 28 | <p> |
| 29 | The most current version of <code>mod_ctrls</code> can be found in the |
| 30 | ProFTPD source distribution: |
| 31 | <pre> |
| 32 | <a href="http://www.proftpd.org/">http://www.proftpd.org/</a> |
| 33 | </pre> |
| 34 | |
| 35 | <h2>Author</h2> |
| 36 | <p> |
| 37 | Please contact TJ Saunders <tj <i>at</i> castaglia.org> with any |
| 38 | questions, concerns, or suggestions regarding this module. |
| 39 | |
| 40 | <h2>Directives</h2> |
| 41 | <ul> |
| 42 | <li><a href="#ControlsACLs">ControlsACLs</a> |
| 43 | <li><a href="#ControlsAuthFreshness">ControlsAuthFreshness</a> |
| 44 | <li><a href="#ControlsEngine">ControlsEngine</a> |
| 45 | <li><a href="#ControlsInterval">ControlsInterval</a> |
| 46 | <li><a href="#ControlsLog">ControlsLog</a> |
| 47 | <li><a href="#ControlsMaxClients">ControlsMaxClients</a> |
| 48 | <li><a href="#ControlsSocket">ControlsSocket</a> |
| 49 | <li><a href="#ControlsSocketACL">ControlsSocketACL</a> |
| 50 | <li><a href="#ControlsSocketOwner">ControlsSocketOwner</a> |
| 51 | </ul> |
| 52 | |
| 53 | <h2>Control Actions</h2> |
| 54 | <ul> |
| 55 | <li><a href="#help"><code>help</code></a> |
| 56 | <li><a href="#insctrl"><code>insctrl</code></a> |
| 57 | <li><a href="#lsctrl"><code>lsctrl</code></a> |
| 58 | <li><a href="#rmctrl"><code>rmctrl</code></a> |
| 59 | </ul> |
| 60 | |
| 61 | <p> |
| 62 | <hr> |
| 63 | <h1>Directives</h1> |
| 64 | |
| 65 | <p> |
| 66 | <hr> |
| 67 | <h3><a name="ControlsACLs">ControlsACLs</a></h3> |
| 68 | <strong>Syntax:</strong> ControlsACLs <em>actions|all allow|deny user|group list</em><br> |
| 69 | <strong>Default:</strong> None<br> |
| 70 | <strong>Context:</strong> server config<br> |
| 71 | <strong>Module:</strong> mod_ctrls<br> |
| 72 | <strong>Compatibility:</strong> 1.2.10rc1 and later |
| 73 | |
| 74 | <p> |
| 75 | The <code>ControlsACLs</code> directive configures access lists of |
| 76 | <em>users</em> or <em>groups</em> who are allowed (or denied) the ability to |
| 77 | use the <em>actions</em> implemented by <code>mod_ctrls</code>. The default |
| 78 | behavior is to deny everyone unless an ACL allowing access has been explicitly |
| 79 | configured. |
| 80 | |
| 81 | <p> |
| 82 | If "allow" is used, then <em>list</em>, a comma-delimited list |
| 83 | of <em>users</em> or <em>groups</em>, can use the given <em>actions</em>; all |
| 84 | others are denied. If "deny" is used, then the <em>list</em> of |
| 85 | <em>users</em> or <em>groups</em> cannot use <em>actions</em> all others are |
| 86 | allowed. Multiple <code>ControlsACLs</code> directives may be used to configure |
| 87 | ACLs for different control actions, and for both users and groups. |
| 88 | |
| 89 | <p> |
| 90 | <hr> |
| 91 | <h3><a name="ControlsAuthFreshness">ControlsAuthFreshness</a></h3> |
| 92 | <strong>Syntax:</strong> ControlsAuthFreshness <em>seconds</em><br> |
| 93 | <strong>Default:</strong> ControlsAuthFreshness 10<br> |
| 94 | <strong>Context:</strong> server config<br> |
| 95 | <strong>Module:</strong> mod_ctrls<br> |
| 96 | <strong>Compatibility:</strong> 1.2.10rc1 and later |
| 97 | |
| 98 | <p> |
| 99 | The <code>ControlsAuthFreshness</code> directive configures the maximum age, |
| 100 | in seconds, for the client's end of a connection. If the client-specific file |
| 101 | is older than the configured age, the connection is denied. |
| 102 | |
| 103 | <p> |
| 104 | <hr> |
| 105 | <h3><a name="ControlsEngine">ControlsEngine</a></h3> |
| 106 | <strong>Syntax:</strong> ControlsEngine <em>on|off</em><br> |
| 107 | <strong>Default:</strong> ControlsEngine on<br> |
| 108 | <strong>Context:</strong> server config<br> |
| 109 | <strong>Module:</strong> mod_ctrls<br> |
| 110 | <strong>Compatibility:</strong> 1.2.10rc1 and later |
| 111 | |
| 112 | <p> |
| 113 | The <code>ControlsEngine</code> directive enables or disables the |
| 114 | <code>mod_ctrls</code> module, and thus the processing of <code>ftpdctl</code> |
| 115 | requests. |
| 116 | |
| 117 | <p> |
| 118 | <hr> |
| 119 | <h3><a name="ControlsInterval">ControlsInterval</a></h3> |
| 120 | <strong>Syntax:</strong> ControlsInterval <em>seconds</em><br> |
| 121 | <strong>Default:</strong> ControlsInterval 10<br> |
| 122 | <strong>Context:</strong> server config<br> |
| 123 | <strong>Module:</strong> mod_ctrls<br> |
| 124 | <strong>Compatibility:</strong> 1.2.10rc1 and later |
| 125 | |
| 126 | <p> |
| 127 | The <code>ControlsInterval</code> directives configures the interval at |
| 128 | which <code>mod_ctrls</code> will check and handle pending |
| 129 | <code>ftpdctl</code> action requests on the Controls socket. <em>seconds</em> |
| 130 | must be a positive number. |
| 131 | |
| 132 | <p> |
| 133 | <hr> |
| 134 | <h3><a name="ControlsLog">ControlsLog</a></h3> |
| 135 | <strong>Syntax:</strong> ControlsLog <em>file</em><br> |
| 136 | <strong>Default:</strong> None<br> |
| 137 | <strong>Context:</strong> server config<br> |
| 138 | <strong>Module:</strong> mod_ctrls<br> |
| 139 | <strong>Compatibility:</strong> 1.2.10rc1 and later |
| 140 | |
| 141 | <p> |
| 142 | The <code>ControlsLog</code> directive configures a file used for logging |
| 143 | by <code>mod_ctrls</code> and possibly other Controls modules. The |
| 144 | configured <em>file</em> must be an absolute path. |
| 145 | |
| 146 | <p> |
| 147 | <hr> |
| 148 | <h3><a name="ControlsMaxClients">ControlsMaxClients</a></h3> |
| 149 | <strong>Syntax:</strong> ControlsMaxClients <em>number</em><br> |
| 150 | <strong>Default:</strong> ControlsMaxClients 5<br> |
| 151 | <strong>Context:</strong> server config<br> |
| 152 | <strong>Module:</strong> mod_ctrls<br> |
| 153 | <strong>Compatibility:</strong> 1.2.10rc1 and later |
| 154 | |
| 155 | <p> |
| 156 | The <code>ControlsMaxClients</code> directive configures the maximum number |
| 157 | of pending client requests that will be handled when <code>mod_ctrls</code> |
| 158 | checks the socket. <em>number</em> must be a positive number. |
| 159 | |
| 160 | <p> |
| 161 | <hr> |
| 162 | <h3><a name="ControlsSocket">ControlsSocket</a></h3> |
| 163 | <strong>Syntax:</strong> ControlsSocket <em>file</em><br> |
| 164 | <strong>Default:</strong> ControlsSocket var/run/proftpd.sock<br> |
| 165 | <strong>Context:</strong> server config<br> |
| 166 | <strong>Module:</strong> mod_ctrls<br> |
| 167 | <strong>Compatibility:</strong> 1.2.10rc1 and later |
| 168 | |
| 169 | <p> |
| 170 | The <code>ControlsSocket</code> directive configures the file to be used |
| 171 | as the Unix domain socket, rather than the default. <em>file</em> must be an |
| 172 | absolute path. Note that if used, <code>ftpdctl</code>'s <code>-s</code> |
| 173 | option will also need to be used. |
| 174 | |
| 175 | <p> |
| 176 | <hr> |
| 177 | <h3><a name="ControlsSocketACL">ControlsSocketACL</a></h3> |
| 178 | <strong>Syntax:</strong> ControlsSocketACL <em>allow|deny user|group list</em><br> |
| 179 | <strong>Default:</strong> None<br> |
| 180 | <strong>Context:</strong> server config<br> |
| 181 | <strong>Module:</strong> mod_ctrls<br> |
| 182 | <strong>Compatibility:</strong> 1.2.10rc1 and later |
| 183 | |
| 184 | <p> |
| 185 | The <code>ControlsSocketACL</code> directive configures an access |
| 186 | <em>list</em> of <em>users</em> or <em>groups</em> who are allowed (or denied) |
| 187 | access to the Unix domain server socket used for receiving action requests. |
| 188 | The default behavior is to deny everyone unless an ACL allowing access has |
| 189 | been explicitly configured. |
| 190 | |
| 191 | <p> |
| 192 | If "allow" is used, then <em>list</em>, a comma-delimited list |
| 193 | of <em>users</em> or <em>groups</em>, can use the control socket; all others |
| 194 | are denied. If "deny" is used, then the <em>list</em> of |
| 195 | <em>users</em> or <em>groups</em> cannot use the control socket; all others |
| 196 | are allowed. A <code>ControlsSocketACL</code> directive with "user" |
| 197 | and one using "group" may be used simultaneously. |
| 198 | |
| 199 | <p> |
| 200 | <hr> |
| 201 | <h3><a name="ControlsSocketOwner">ControlsSocketOwner</a></h3> |
| 202 | <strong>Syntax:</strong> ControlsSocketOwner <em>user group</em><br> |
| 203 | <strong>Default:</strong> ControlsSocketOwner <em>root root</em><br> |
| 204 | <strong>Context:</strong> server config<br> |
| 205 | <strong>Module:</strong> mod_ctrls<br> |
| 206 | <strong>Compatibility:</strong> 1.2.10rc1 and later |
| 207 | |
| 208 | <p> |
| 209 | The <code>ControlsSocketOwner</code> directive configures the ownership of |
| 210 | the Unix domain socket file created when <code>mod_ctrls</code> starts up. |
| 211 | The ownership of this file (and its mode) can also be used as a form of |
| 212 | access control. |
| 213 | |
| 214 | <p> |
| 215 | <hr> |
| 216 | <h1>Control Actions</h1> |
| 217 | |
| 218 | <p> |
| 219 | <hr> |
| 220 | <h3><a name="help"><code>help</code></a></h3> |
| 221 | <strong>Syntax:</strong> ftpdctl help<br> |
| 222 | <strong>Purpose:</strong> Display a sorted list of active controls and their descriptions |
| 223 | |
| 224 | <p> |
| 225 | The <code>help</code> control action can be used to obtain a sorted list of all |
| 226 | active control actions, and their descriptions. |
| 227 | |
| 228 | <p> |
| 229 | <hr> |
| 230 | <h3><a name="insctrl"><code>insctrl</code></a></h3> |
| 231 | <strong>Syntax:</strong> ftpdctl insctrl <em>action|all [module]</em><br> |
| 232 | <strong>Purpose:</strong> Enable control actions |
| 233 | |
| 234 | <p> |
| 235 | The <code>insctrl</code> control action can be used to enable any disabled |
| 236 | control action by name. The special "<code>insctrl all</code>" enables |
| 237 | <b>all</b> disabled control actions. Once a specific action has been enabled |
| 238 | (most control actions are enabled by default) , the |
| 239 | "<a href="#rmctrl">rmctrl</a>" control action can be used to disable |
| 240 | it. |
| 241 | |
| 242 | <p> |
| 243 | Example: |
| 244 | <pre> |
| 245 | ftpdctl insctrl debug |
| 246 | </pre> |
| 247 | |
| 248 | <p> |
| 249 | <hr> |
| 250 | <h3><a name="lsctrl"><code>lsctrl</code></a></h3> |
| 251 | <strong>Syntax:</strong> ftpdctl lsctrl<br> |
| 252 | <strong>Purpose:</strong> Display a sorted list of all active control actions |
| 253 | |
| 254 | <p> |
| 255 | The <code>lsctrl</code> control action can be used obtain a sorted list of all |
| 256 | active control actions. The list will include the name of the action as well as |
| 257 | the module that implements that action. |
| 258 | |
| 259 | <p> |
| 260 | <hr> |
| 261 | <h3><a name="rmctrl"><code>rmctrl</code></a></h3> |
| 262 | <strong>Syntax:</strong> ftpdctl rmctrl <em>action|all [module]</em><br> |
| 263 | <strong>Purpose:</strong> Disable control actions |
| 264 | |
| 265 | <p> |
| 266 | The <code>rmctrl</code> control action can be used to disable any registered |
| 267 | control action by name, except for the actions registered by |
| 268 | <code>mod_ctrls</code>: "insctrl", "lsctrl", and |
| 269 | "rmctrl". The exception to this is the special "<code>rmctrl |
| 270 | all</code>", which disables <b>all</b> actions and effectively turns |
| 271 | <code>mod_ctrls</code> off. A daemon restart is then necessary to re-enable |
| 272 | actions. Once a specific action has been disabled, the |
| 273 | "<a href="#insctrl">insctrl</a>" control action can be used to |
| 274 | re-enable it. |
| 275 | |
| 276 | <p> |
| 277 | Example: |
| 278 | <pre> |
| 279 | ftpdctl rmctrl memory |
| 280 | </pre> |
| 281 | This disables all actions registered under the name "memory". If |
| 282 | there was such an action registered by a specific module, |
| 283 | <code>mod_ctrls_common</code> for example, that the administrator wished to |
| 284 | disable, but to leave the "memory" actions of other modules enabled: |
| 285 | <pre> |
| 286 | ftpdctl rmctrl memory mod_ctrls_common.c |
| 287 | </pre> |
| 288 | |
| 289 | <p> |
| 290 | <hr> |
| 291 | <h2><a name="Usage">Usage</a></h2> |
| 292 | The determination of "freshness" is part of determining client |
| 293 | credentials. The method used by <code>mod_ctrls</code> comes from |
| 294 | Stevens' <i>Advanced Programming in the Unix Environment</i>, chapter 15. |
| 295 | Admittedly having kernel-provided client credentials would be <b>much</b> nicer, |
| 296 | but portably obtaining them is next to impossible. On some flavors of Unix |
| 297 | it simply cannot be done. Stevens' method is the next best thing right now. |
| 298 | |
| 299 | <p> |
| 300 | <b>Logging</b><br> |
| 301 | The <code>mod_ctrls</code> module supports <a href="../howto/Tracing.html">trace logging</a>, via the module-specific log channels: |
| 302 | <ul> |
| 303 | <li>ctrls |
| 304 | </ul> |
| 305 | Thus for trace logging, to aid in debugging, you would use the following in |
| 306 | your <code>proftpd.conf</code>: |
| 307 | <pre> |
| 308 | TraceLog /path/to/ftpd/trace.log |
| 309 | Trace ctrls:20 |
| 310 | </pre> |
| 311 | This trace logging can generate large files; it is intended for debugging use |
| 312 | only, and should be removed from any production configuration. |
| 313 | |
| 314 | <p> |
| 315 | <hr> |
| 316 | <h2><a name="Installation">Installation</a></h2> |
| 317 | The <code>mod_ctrls</code> module is distributed with ProFTPD. To enable |
| 318 | use of Controls, use the <code>--enable-ctrls</code> configure option: |
| 319 | <pre> |
| 320 | $ ./configure --enable-ctrls |
| 321 | $ make |
| 322 | $ make install |
| 323 | </pre> |
| 324 | This option causes <code>mod_ctrls</code> to be compiled into |
| 325 | <code>proftpd</code>. |
| 326 | |
| 327 | <p> |
| 328 | <hr> |
| 329 | <font size=2><b><i> |
| 330 | © Copyright 2000-2016 TJ Saunders<br> |
| 331 | All Rights Reserved<br> |
| 332 | </i></b></font> |
| 333 | <hr> |
| 334 | |
| 335 | </body> |
| 336 | </html> |
| 337 |