41.9. Message and Readme Files

WU-FTPD can be configured to send the contents of various message files to clients when they log in or enter certain directories. This can be useful to display information about your FTP server (such as who runs it and what files are hosted) or details of the contents of a particular directory to FTP users. Each file is only sent once to a client in a single session, to avoid annoying the user with repeated messages.

The server can also be set up to notify clients that certain files exist and inform them of their last modification dates. This is typically used for README files containing slightly less important information about a directory or the server, which users may want to read. Again, clients are only notified once per session for each such file.

To define message and banner files, follow these steps:

1.
Click on the Messages and Banners icon on the module's main page, which will take you to the form shown in Figure 41.4.

Figure 41.4. The messages and banners form.


2.
The Message files section is a table for specifying files whose contents will be sent to clients. As usual with tables in Webmin, it lists existing files and their contexts, and has one blank row at the bottom for adding a new one. The meanings of the fields are:

Path The path to the file whose contents should be sent to the client. This can be either an absolute path like /etc/login.message or a relative filename like message.txt. In the latter case, it is looked for in each directory that the client enters. If you enter a full path and want anonymous clients to be able to see it, it must be under the anonymous FTP root directory.

When to display If At login is selected, the file will be sent to clients after logging in. If Entering any dir is chosen, the file will be searched for and sent when changing to any directory. When Entering dir is chosen, the file will only be sent when the directory whose path you specify in the adjacent text box is entered. Again, this must be relative to the root directory for anonymous clients.

Classes to display for If this field is left blank, the message is sent to all clients. If one or more classes of client is entered (separated by spaces), however, it will only be used for clients that fall into those classes. This can be useful for defining message files just for anonymous users, especially when using absolute paths.

3.
To define files that clients will be notified that they exist, you will need to fill in the README files table. Again, this lists all existing files and has a blank row for adding a single new one. The meanings of the fields in this table's columns are:

Path The path to the file whose existence and modification time should be sent to the client. This can be either an absolute path like /etc/README or a filename relative to the directory being entered like README.txt. You can even use shell wildcard characters like * and ? in the filename to match multiple files—for example, README*.

When to display last modified date If At login is selected, the information will be sent to clients after logging in. If Entering any dir is chosen, the file will be searched for and its modification date sent when changing to any directory. When Entering dir is chosen, the modification date will only be sent when the directory whose path you specify in the adjacent text box is entered.

Classes to display for If this field is left blank, the modification is sent to all clients. If one or more classes of client is entered (separated by spaces), however, it will only be used for clients that fall into those classes.

4.
To change the amount of information that WU-FTPD sends to clients when they connect, adjust the Greeting level field. If Hostname and version is selected, both the system's hostname and the FTP server version will be sent. If just Hostname is chosen, only the hostname will be displayed. If Neither is selected, no information will be sent. The latter two options are the most secure, as an attacker may be able to use your FTP server's version to find a bug in it that could be exploited to take over your system.

5.
If you want to have the server send a message to clients as soon as they connect, put it in a file and select the From file option for the Pre-login banner file field. Then, enter the full path to the message file into the text box next to it.

6.
To change the hostname that WU-FTPD sends in the greeting and other messages, select the second option in the Hostname for messages field and enter an alternative name in the text box. This can be useful if your system's real hostname does not match the name the FTP clients use (server5.example.com instead of ftp.example.com, for example).

7.
When you are done with this form, click the Save button to activate your changes. They will apply to all new FTP clients that connect from now on.

On many operating systems, the WU-FTPD configuration will include one or two messages and README file definitions by default. The .message file is typically searched for in every directory and sent to clients, as is the modification time of any file whose name matches the README* pattern.

Any message files that you define can contain special codes starting with % that are replaced when the file is sent by dynamically generated text. For example, %U is replaced with the client's FTP login name, so a file containing the line Welcome %U to the example.com FTP server would be sent to the client as something like Welcome jcameron to the example.com FTP server. According to the WU-FTPD manual page, the available codes are those shown in Table 41.1.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
52.14.151.45