| 1 | <!DOCTYPE html> |
| 2 | <html> |
| 3 | <head> |
| 4 | <title>ProFTPD module mod_wrap2_file</title> |
| 5 | </head> |
| 6 | |
| 7 | <body bgcolor=white> |
| 8 | |
| 9 | <hr><br> |
| 10 | <center> |
| 11 | <h2><b>ProFTPD module <code>mod_wrap2_file</code></b></h2> |
| 12 | </center> |
| 13 | <hr><br> |
| 14 | |
| 15 | <p> |
| 16 | This submodule provides the file-specific "driver" for storing |
| 17 | IP/DNS-based access control information in files. |
| 18 | |
| 19 | <p> |
| 20 | Many programs will automatically add entries in the common |
| 21 | <code>hosts.allow</code>/<code>hosts.deny</code> files, and use of this module |
| 22 | will allow a <code>proftpd</code> daemon running in <code>standalone</code> |
| 23 | mode to adapt as these entries are added. The <code>portsentry</code> program |
| 24 | does this, for example: when illegal access is attempted, it will add hosts to |
| 25 | the <code>/etc/hosts.deny</code> file. |
| 26 | |
| 27 | <p> |
| 28 | This <code>mod_wrap2</code> submodule is contained in the |
| 29 | <code>mod_wrap2_file.c</code>, and is not compiled by default. See the |
| 30 | <code>mod_wrap2</code> <a href="mod_wrap2.html#Installation">installation</a> |
| 31 | instructions. |
| 32 | |
| 33 | <h2>Author</h2> |
| 34 | <p> |
| 35 | Please contact TJ Saunders <tj <i>at</i> castaglia.org> with any |
| 36 | questions, concerns, or suggestions regarding this module. |
| 37 | |
| 38 | <p> |
| 39 | <hr><h2><a name="FileTables">File Access Tables</a></h2> |
| 40 | Using file-based access tables (<em>source-type</em> of "file") the |
| 41 | data will be stored in the familiar <code>hosts.allow</code>, |
| 42 | <code>hosts.deny</code> file format. |
| 43 | |
| 44 | <p> |
| 45 | The <code>mod_wrap2_file</code> module supports the "file" string |
| 46 | for the <em>source-type</em> parameter of the |
| 47 | <a href="mod_wrap2.html#WrapUserTables"><code>WrapUserTables</code></a>, |
| 48 | <a href="mod_wrap2.html#WrapGroupTables"><code>WrapGroupTables</code></a>, |
| 49 | and |
| 50 | <a href="mod_wrap2.html#WrapTables"><code>WrapTables</code></a>, |
| 51 | configuration directives. If the "file" <em>source-type</em> |
| 52 | is used, then the <em>source-info</em> parameter must be the full path to |
| 53 | the file table. |
| 54 | |
| 55 | <p> |
| 56 | Both file names are required. Also, the paths to both files must be the full |
| 57 | path, with two exceptions: if the path starts with <code>~/</code>, the check |
| 58 | of that path will be delayed until a user requests a connection, at which time |
| 59 | the path will be resolved to that user's home directory; or if the path starts |
| 60 | with <code>~user/</code>, where user is some system user. In this latter case, |
| 61 | <code>mod2_wrap</code> will attempt to resolve and verify the given user's home |
| 62 | directory on start-up. The <code>%U</code> variable can also be used in the |
| 63 | paths; it will be resolved to the <code>USER</code> name sent by the client. |
| 64 | |
| 65 | <p> |
| 66 | The format for the files used by <code>mod_wrap2_file</code> is described |
| 67 | in the <code>host_access(5)</code> man page. |
| 68 | |
| 69 | <p> |
| 70 | Examples: |
| 71 | <pre> |
| 72 | # Server-wide access files |
| 73 | WrapTables file:/etc/hosts.allow file:/etc/hosts.deny |
| 74 | |
| 75 | # FTP server-specific access files |
| 76 | WrapTables file:/etc/ftpd.allow file:/etc/ftpd.deny |
| 77 | |
| 78 | # Per-user access files, which are to be found in the user's home directory |
| 79 | WrapUserTables file:~/my.allow file:~/my.deny |
| 80 | |
| 81 | # Per-user access files, which are <b>not</b> found in the user's home. |
| 82 | WrapUserTables file:/etc/ftpd/acls/%U.allow file:/etc/ftpd/acls/%U.deny |
| 83 | </pre> |
| 84 | |
| 85 | <p> |
| 86 | <hr><h2><a name="FileExamples">Example File Tables</a></h2> |
| 87 | The following examples are taken from the <code>hosts_access(5)</code> man page: |
| 88 | |
| 89 | <p> |
| 90 | <b>Mostly Closed</b><br> |
| 91 | In this case, access is denied by default. Only explicitly authorized hosts |
| 92 | are permitted access. |
| 93 | |
| 94 | <p> |
| 95 | The default policy (no access) is implemented with a trivial deny file: |
| 96 | <pre> |
| 97 | /etc/hosts.deny: |
| 98 | ALL: ALL |
| 99 | </pre> |
| 100 | This denies all service to all hosts, unless they are permitted access by |
| 101 | entries in the allow file. |
| 102 | |
| 103 | <p> |
| 104 | The explicitly authorized hosts are listed in the allow file. For example: |
| 105 | <pre> |
| 106 | /etc/hosts.allow: |
| 107 | ALL: LOCAL @some_netgroup |
| 108 | ALL: .foobar.edu EXCEPT terminalserver.foobar.edu |
| 109 | </pre> |
| 110 | The first rule permits access from hosts in the local domain (no `.' in the |
| 111 | host name) and from members of the <em>some_netgroup</em> netgroup. The |
| 112 | second rule permits access from all hosts in the <em>.foobar.edu</em> domain |
| 113 | (notice the leading dot), with the exception of |
| 114 | <em>terminalserver.foobar.edu</em>. |
| 115 | |
| 116 | <p> |
| 117 | <b>Mostly Open</b><br> |
| 118 | Here, access is granted by default; only explicitly specified hosts are |
| 119 | refused service. |
| 120 | |
| 121 | <p> |
| 122 | The default policy (access granted) makes the allow file redundant so that it |
| 123 | can be omitted. The explicitly non-authorized hosts are listed in the deny |
| 124 | file. For example: |
| 125 | <pre> |
| 126 | /etc/hosts.deny: |
| 127 | ALL: some.host.name, .some.domain |
| 128 | ALL EXCEPT in.fingerd: other.host.name, .other.domain |
| 129 | </pre> |
| 130 | The first rule denies some hosts and domains all services; the second rule |
| 131 | still permits finger requests from other hosts and domains. |
| 132 | |
| 133 | <p> |
| 134 | <hr> |
| 135 | <font size=2><b><i> |
| 136 | © Copyright 2000-2017 TJ Saunders<br> |
| 137 | All Rights Reserved<br> |
| 138 | </i></b></font> |
| 139 | <hr> |
| 140 | |
| 141 | </body> |
| 142 | </html> |
| 143 |