Book Image

MariaDB Cookbook

By : Daniel Bartholomew
Book Image

MariaDB Cookbook

By: Daniel Bartholomew

Overview of this book

Table of Contents (20 chapters)
MariaDB Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Authenticating using the PAM authentication plugin


We're not limited to using MariaDB's built-in authentication system. We can also authenticate users using Linux's Pluggable Authentication Modules (PAM) system. Using PAM can enable authentication schemes far beyond what MariaDB provides, including things such as using biometric scanners, authenticator token generators, and so on.

Getting ready

The PAM authentication plugin is only available on Linux, so the server-side portions of this recipe are Linux-only. The mysql command-line client on Windows can make use of the PAM authentication on a Linux-based MariaDB server so that part of the recipe is cross-platform.

How to do it...

  1. On Debian or Ubuntu systems, add the system mysql user to the shadow group using the following command:

    sudo adduser mysql shadow
    
  2. Create a new system-login account named pamuser using either the useradd or adduser commands and set the user's password using the following statements:

    sudo adduser pamuser
    sudo passwd pamuser...