Since proftpd supports multiple authentication modules at the
same time, how does it know which authentication module to use? What if you
want to tell proftpd which modules to check, and in which order?
What if you want some authentication modules to be used in one
<VirtualHost>, and different authentication modules in
another?
By default, proftpd will ask every configured authentication
module about a given user, until it finds an authentication module that knows
about that user, or until an authentication module signals an unrecoverable
error. The order in which these modules are asked depends on the order of
modules in the --with-modules option used when configuring
proftpd.
Some modules can be figured to not "play nice" and allow other
authentication modules a chance at providing user information. That is, some
modules can be "authoritative", and if that module does not know
about the user, it will signal an error and prevent proftpd
from asking other modules. mod_auth_pam's
AuthPAMAuthoritative directive, and the * syntax
in the SQLAuthenticate directive of mod_sql, are
examples of this authoritativeness. In general, it is best to avoid using
such mechanisms, and to use the
AuthOrder configuration directive instead.
The following illustrates a situation where AuthOrder is
useful. The default build of proftpd has two authentication
modules included: mod_auth_file and mod_auth_unix.
proftpd will consult both modules when authenticating a
user: first mod_auth_file, then mod_auth_unix.
(Note: versions of proftpd before 1.2.8rc1 would only
support either AuthUserFile or /etc/passwd, but not
both at the same time.) If any authentication module can authenticate a user,
then authentication succeeds. This holds true of other authentication modules
like mod_ldap, mod_sql, mod_radius,
etc.
However, if you only want proftpd to use your
AuthUserFile and no other authentication modules, then you would
use the AuthOrder directive like this:
AuthOrder mod_auth_file.c
Or, if you use mod_sql and wanted proftpd to check
your SQL tables first, and then default to system users:
AuthOrder mod_sql.c mod_auth_unix.c
Note that the mod_auth.c module should never be used in an
AuthOrder directive.
Frequently Asked Questions
Question: How can I configure proftpd to
log/show the password typed by the user?
Answer: You cannot. Period. The proftpd
code goes out of its way to ensure that the password is never logged.
© Copyright 2017 The ProFTPD Project
All Rights Reserved