File-based Authentication

Warning

auth_file is a security risk! Do not use this plugin with production servers!

auth_file is an Authorization plugin that authenticates connections using a list of username:password entries in a plain text file. When drizzled is started with --plugin-add=auth_file, the file based authorization plugin is enabled with the default users file. Users file can be specified by either specifying --auth-file.users=<users file> at the time of server startup or by changing the auth_file_users with SET GLOBAL.

Note

Unload the Allow All Authentication plugin before using this plugin.

See also

Authentication

Loading

To load this plugin, start drizzled with:

--plugin-add=auth_file

Loading the plugin may not enable or configure it. See the plugin’s Configuration and Variables.

See also

Plugin Options for more information about adding and removing plugins.

Configuration

These command line options configure the plugin when drizzled is started. See Command Line Options for more information about specifying command line options.

--auth-file.users ARG
Default :BASEDIR/etc/drizzle.users
Variable :auth_file_users

File to load for usernames and passwords.

Variables

These variables show the running configuration of the plugin. See variables for more information about querying and setting variables.

  • auth_file_users

    Scope:Global
    Dynamic:Yes
    Option:--auth-file.users

    File to load for usernames and passwords.

Examples

First, create a users file with one user:pass entry per line, like:

user1:password1
user2:password2

Then start drizzled like:

sbin/drizzled --plugin-remove=auth_all \
              --plugin-add=auth_file   \
              --auth-file.users=/path/to/my/users

Test that it works:

$ drizzle
ERROR 1045 (28000): Access denied for user 'daniel' (using password: NO)

$ drizzle --user=user1
ERROR 1045 (28000): Access denied for user 'user1' (using password: NO)

$ drizzle --user=user1 --password=password1
Welcome to the Drizzle client..  Commands end with ; or \g.
...

Changing users file at runtime

Users file can be reloaded by:

SET GLOBAL auth_file_users=@@auth_file_users

Moreover, the users file can be changed by:

SET GLOBAL auth_file_users=/path/to/new/users/file

Authors

Eric Day

Version

This documentation applies to auth_file 0.1.

To see which version of the plugin a Drizzle server is running, execute:

SELECT MODULE_VERSION FROM DATA_DICTIONARY.MODULES WHERE MODULE_NAME='auth_file'

Changelog

v0.1

  • First release.

Table Of Contents

Previous topic

Allow All Authentication

Next topic

HTTP Authentication

This Page