40.10. Message and Readme Files

ProFTPD can be configured to display messages to clients when they log in or enter certain directories. This can be useful for notifying users of possible mirror sites, the locations of various common files on the server, and the details of the contents of a directory.

To set the messages that are displayed to clients, follow these steps:

1.
If you want the messages to be used by all virtual servers, click on the Authentication icon on the module's main page. To set messages for a specific virtual server, click on its icon and then on Authentication on the server options page. Either way, the same form will be displayed.

It is also possible to set most of the message file options below for only anonymous clients by clicking on the Anonymous FTP icon on the virtual server page and then on Authentication. Naturally, you cannot set the pre-login message because the server does not know if a client is anonymous or not at that stage.

2.
In the Pre-login message file field, enter the full path to a file whose contents should be sent to clients as soon as they connect. If you don't want any message file to be used at all, select None instead.

3.
In the Post-login message file field, enter the path to a text file whose contents will be sent to clients after they have been properly authenticated. If the client is limited to a directory (because it logged in anonymously or has a home directory restriction in force), the file must be within and relative to that directory. If the filename is relative (like welcome.txt), it will be searched for in the directory in which the client is initially placed.

4.
To set a message sent to clients when they request to disconnect, fill in the Logout message file field. Again, this must be relative to and under any directory in which the client is restricted.

5.
If you have a restriction on the maximum number of simultaneous logins in force, you can set the message sent to clients blocked by it by filling in the Too many connections message file field. You should enter a full path, which can be anywhere on your system. See Section 40.14 “Limiting Concurrent Logins” for more details.

6.
Hit the Save button at the bottom of the page to go back to the global, virtual server or anonymous FTP options page.

7.
Click on the Files and Directories icon on the same page.

8.
In the Directory README filename field, enter a relative name like readme.txt that will be searched for in each directory that a client enters. If this is the first time the client has entered the directory in this session (or if the file has changed since the last time), its contents will be sent to the FTP client.

9.
To have the server send a message to clients suggesting that a particular file should be read, fill in the Notify user of readme files matching field. If files in the directory matching the specified regular expression (like README.*) exist, a short message containing their names and modification times will be sent.

10.
Click the Save button on this form, then return to the module's main page. Finally, click the Apply Changes button to activate the new message file settings.

The files sent to the client by the options covered above can contain certain special cookies that start with a %, which are replaced by ProFTPD with text determined at the time of sending. According to the ProFTPD documentation, the currently supported cookies are listed in Table 40.1.

Not all may make sense in all situations though. For example, %U will not be set in the pre-login message file.

Table 40.1. Cookies Usable in Files
%TCurrent date and time
%FAvailable space on file system
%CCurrent working directory
%RRemote host name
%LLocal host name
%uRemote username reported by ident protocol
%UUsername originally used in login
%MMax number of connections
%NCurrent number of connections
%EServer administrator's email address
%xThe name of the user's class
%yCurrent number of connections from the user's class
%zMaximum number of connections from the user's class

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

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