| 1 | <!-- $Id: DisplayFiles.html,v 1.7 2010/04/17 18:52:35 castaglia Exp $ --> |
|---|
| 2 | <!-- $Source: /cvsroot/proftp/proftpd/doc/howto/DisplayFiles.html,v $ --> |
|---|
| 3 | |
|---|
| 4 | <html> |
|---|
| 5 | <head> |
|---|
| 6 | <title>ProFTPD mini-HOWTO - Display Files</title> |
|---|
| 7 | </head> |
|---|
| 8 | |
|---|
| 9 | <body bgcolor=white> |
|---|
| 10 | |
|---|
| 11 | <hr> |
|---|
| 12 | <center><h2><b>ProFTPD's <code>Display</code> Files</b></h2></center> |
|---|
| 13 | <hr> |
|---|
| 14 | |
|---|
| 15 | <p> |
|---|
| 16 | ProFTPD supports a number of configuration directives that specify a file |
|---|
| 17 | whose contents should be displayed to connected clients at various times: |
|---|
| 18 | <ul> |
|---|
| 19 | <li> |
|---|
| 20 | <dt><code>DisplayConnect</code> |
|---|
| 21 | <dd>Displayed to clients as soon as they connect</dd> |
|---|
| 22 | </li> |
|---|
| 23 | |
|---|
| 24 | <p> |
|---|
| 25 | <li> |
|---|
| 26 | <dt><code>DisplayLogin</code> |
|---|
| 27 | <dd>Displayed to clients once they have logged in using the |
|---|
| 28 | <code>USER</code> and <code>PASS</code> commands</dd> |
|---|
| 29 | </li> |
|---|
| 30 | |
|---|
| 31 | <p> |
|---|
| 32 | <li> |
|---|
| 33 | <dt><code>DisplayChdir</code> |
|---|
| 34 | <dd>Displayed to a client whenever it changes into a directory</dd> |
|---|
| 35 | </li> |
|---|
| 36 | |
|---|
| 37 | <p> |
|---|
| 38 | <li> |
|---|
| 39 | <dt><code>DisplayFileTransfer</code> |
|---|
| 40 | <dd>Displayed to the client whenever a file is successfully transfer, |
|---|
| 41 | either uploaded or downloaded</dd> |
|---|
| 42 | </li> |
|---|
| 43 | |
|---|
| 44 | <p> |
|---|
| 45 | <li> |
|---|
| 46 | <dt><code>DisplayQuit</code> |
|---|
| 47 | <dd>Displayed to a client when the session ends via the <code>QUIT</code> |
|---|
| 48 | command</dd> |
|---|
| 49 | </li> |
|---|
| 50 | </ul> |
|---|
| 51 | |
|---|
| 52 | <p> |
|---|
| 53 | Note the subtle difference between <code>DisplayConnect</code> and |
|---|
| 54 | <code>DisplayLogin</code>. A <code>DisplayConnect</code> file will be |
|---|
| 55 | displayed to all clients; this makes it suitable for server banners, |
|---|
| 56 | messages of the day, <i>etc</i>. A <code>DisplayLogin</code> file will only |
|---|
| 57 | be displayed once the client has logged in. |
|---|
| 58 | |
|---|
| 59 | <p> |
|---|
| 60 | The configured file paths can be either relative or absolute (except in the |
|---|
| 61 | case of <code>DisplayConnect</code>, which always requires absolute paths). |
|---|
| 62 | In the case of a relative path, the file is assumed to be in the starting |
|---|
| 63 | directory a user, <i>i.e.</i> the <code><Anonymous></code> directory |
|---|
| 64 | for anonymous logins, and the user's home directory for non-anonymous logins. |
|---|
| 65 | <b>Note</b>: If <code>DefaultRoot</code> is in effect, then the file |
|---|
| 66 | <b>must</b> reside inside the <code>chroot</code>ed directory. If the |
|---|
| 67 | configured file cannot be found or accessed, no error occurs and nothing is |
|---|
| 68 | logged or displayed to the client. |
|---|
| 69 | |
|---|
| 70 | <p> |
|---|
| 71 | <b><code>Display</code> Variables</b><br> |
|---|
| 72 | The following table contains the variables that can be used in |
|---|
| 73 | <code>Display</code> files. Be aware that not all of these may have a rational |
|---|
| 74 | value, depending on the context in which they are used (<i>e.g.</i>, |
|---|
| 75 | <code>%u</code> if <code>IdentLookups</code> are <em>off</em>). |
|---|
| 76 | |
|---|
| 77 | <p> |
|---|
| 78 | Other <code>contrib</code> modules may provide additional variables for use |
|---|
| 79 | as well; please consult their documentation for more information. |
|---|
| 80 | |
|---|
| 81 | <p> |
|---|
| 82 | <table border=1> |
|---|
| 83 | <tr> |
|---|
| 84 | <td><b>Variable</b></td> |
|---|
| 85 | <td><b>Meaning</b></td> |
|---|
| 86 | </tr> |
|---|
| 87 | |
|---|
| 88 | <tr> |
|---|
| 89 | <td>%C</td> |
|---|
| 90 | <td>Current working directory</td> |
|---|
| 91 | </tr> |
|---|
| 92 | |
|---|
| 93 | <tr> |
|---|
| 94 | <td>%E</td> |
|---|
| 95 | <td>Server admin's email address</td> |
|---|
| 96 | </tr> |
|---|
| 97 | |
|---|
| 98 | <tr> |
|---|
| 99 | <td>%F</td> |
|---|
| 100 | <td>Available space on file system, in bytes</td> |
|---|
| 101 | <tr> |
|---|
| 102 | |
|---|
| 103 | <tr> |
|---|
| 104 | <td>%f</td> |
|---|
| 105 | <td>Available space on file system, with units</td> |
|---|
| 106 | </tr> |
|---|
| 107 | |
|---|
| 108 | <tr> |
|---|
| 109 | <td>%i</td> |
|---|
| 110 | <td>The number of files uploaded (input) in this session</td> |
|---|
| 111 | </tr> |
|---|
| 112 | |
|---|
| 113 | <tr> |
|---|
| 114 | <td>%K</td> |
|---|
| 115 | <td>Total number of bytes transferred</td> |
|---|
| 116 | </tr> |
|---|
| 117 | |
|---|
| 118 | <tr> |
|---|
| 119 | <td>%k</td> |
|---|
| 120 | <td>Total number of bytes transferred, in units</td> |
|---|
| 121 | </tr> |
|---|
| 122 | |
|---|
| 123 | <tr> |
|---|
| 124 | <td>%L</td> |
|---|
| 125 | <td>Local hostname</td> |
|---|
| 126 | </tr> |
|---|
| 127 | |
|---|
| 128 | <tr> |
|---|
| 129 | <td>%M</td> |
|---|
| 130 | <td>Maximum number of connections</td> |
|---|
| 131 | </tr> |
|---|
| 132 | |
|---|
| 133 | <tr> |
|---|
| 134 | <td>%N</td> |
|---|
| 135 | <td>Current number of connections</td> |
|---|
| 136 | </tr> |
|---|
| 137 | |
|---|
| 138 | <tr> |
|---|
| 139 | <td>%o</td> |
|---|
| 140 | <td>The number of files downloaded (output) in this session</td> |
|---|
| 141 | </tr> |
|---|
| 142 | |
|---|
| 143 | <tr> |
|---|
| 144 | <td>%R</td> |
|---|
| 145 | <td>Remote hostname</td> |
|---|
| 146 | </tr> |
|---|
| 147 | |
|---|
| 148 | <tr> |
|---|
| 149 | <td>%T</td> |
|---|
| 150 | <td>Current time</td> |
|---|
| 151 | </tr> |
|---|
| 152 | |
|---|
| 153 | <tr> |
|---|
| 154 | <td>%t</td> |
|---|
| 155 | <td>The number of files transferred (uploaded and downloaded) in this session</td> |
|---|
| 156 | </tr> |
|---|
| 157 | |
|---|
| 158 | <tr> |
|---|
| 159 | <td>%U</td> |
|---|
| 160 | <td>Username originally used to login</td> |
|---|
| 161 | </tr> |
|---|
| 162 | |
|---|
| 163 | <tr> |
|---|
| 164 | <td>%u</td> |
|---|
| 165 | <td>Username reported by ident protocol</td> |
|---|
| 166 | </tr> |
|---|
| 167 | |
|---|
| 168 | <tr> |
|---|
| 169 | <td>%V</td> |
|---|
| 170 | <td><code>ServerName</code> of virtual host, if any</td> |
|---|
| 171 | </tr> |
|---|
| 172 | |
|---|
| 173 | <tr> |
|---|
| 174 | <td>%x</td> |
|---|
| 175 | <td>The name of the user's <code>Class</code>, if any</td> |
|---|
| 176 | </tr> |
|---|
| 177 | |
|---|
| 178 | <tr> |
|---|
| 179 | <td>%y</td> |
|---|
| 180 | <td>Current number of connections from the user's <code>Class</code></td> |
|---|
| 181 | </tr> |
|---|
| 182 | |
|---|
| 183 | <tr> |
|---|
| 184 | <td>%z</td> |
|---|
| 185 | <td>Maximum number of connections from the user's <code>Class</code></td> |
|---|
| 186 | </tr> |
|---|
| 187 | |
|---|
| 188 | <tr> |
|---|
| 189 | <td>%{total_bytes_in}</td> |
|---|
| 190 | <td>The number of bytes uploaded (input) in this session</td> |
|---|
| 191 | </tr> |
|---|
| 192 | |
|---|
| 193 | <tr> |
|---|
| 194 | <td>%{total_bytes_out}</td> |
|---|
| 195 | <td>The number of bytes downloaded (output) in this session</td> |
|---|
| 196 | </tr> |
|---|
| 197 | |
|---|
| 198 | <tr> |
|---|
| 199 | <td>%{total_bytes_xfer}</td> |
|---|
| 200 | <td>The number of bytes transferred (uploaded and downloaded) in this session</td> |
|---|
| 201 | </tr> |
|---|
| 202 | |
|---|
| 203 | <tr> |
|---|
| 204 | <td>%{total_files_in}</td> |
|---|
| 205 | <td>The number of files uploaded (input) in this session</td> |
|---|
| 206 | </tr> |
|---|
| 207 | |
|---|
| 208 | <tr> |
|---|
| 209 | <td>%{total_files_out}</td> |
|---|
| 210 | <td>The number of files downloaded (output) in this session</td> |
|---|
| 211 | </tr> |
|---|
| 212 | |
|---|
| 213 | <tr> |
|---|
| 214 | <td>%{total_files_xfer}</td> |
|---|
| 215 | <td>The number of files transferred (uploaded and downloaded) in this session</td> |
|---|
| 216 | </tr> |
|---|
| 217 | |
|---|
| 218 | <tr> |
|---|
| 219 | <td>%{env:<i>name</i>}</td> |
|---|
| 220 | <td>The value of the environment variable <i>name</i></td> |
|---|
| 221 | </tr> |
|---|
| 222 | |
|---|
| 223 | <tr> |
|---|
| 224 | <td>%{time:<i>format</i>}</td> |
|---|
| 225 | <td>Uses <i>format</i> (as per the <code>strftime(3)</code> function) to format a timestamp</td> |
|---|
| 226 | </tr> |
|---|
| 227 | </table> |
|---|
| 228 | |
|---|
| 229 | <p><a name="FAQ"></a> |
|---|
| 230 | <b>Frequently Asked Questions</b><br> |
|---|
| 231 | |
|---|
| 232 | <p><a name="DisplayPathsWithSpaces"> |
|---|
| 233 | <font color=red>Question</font>: I configured path which contains spaces for |
|---|
| 234 | <code>DisplayLogin</code>, and it doesn't work. Why not?<br> |
|---|
| 235 | <font color=blue>Answer</font>: If using paths/files which contains spaces, |
|---|
| 236 | make sure that you enclose the path in quotation marks, <i>e.g.</i>: |
|---|
| 237 | <pre> |
|---|
| 238 | DisplayLogin "/path/to/display login.txt" |
|---|
| 239 | </pre> |
|---|
| 240 | Otherwise, the configuration file parser will treat the space-separated |
|---|
| 241 | portions of the path as separate directive parameters. |
|---|
| 242 | |
|---|
| 243 | <p> |
|---|
| 244 | <hr> |
|---|
| 245 | <i>$Date: 2010/04/17 18:52:35 $</i><br> |
|---|
| 246 | |
|---|
| 247 | </body> |
|---|
| 248 | </html> |
|---|