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 mysq
l 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...
On Debian or Ubuntu systems, add the system
mysql
user to theshadow
group using the following command:sudo adduser mysql shadow
Create a new system-login account named
pamuser
using either theuseradd
oradduser
commands and set the user's password using the following statements:sudo adduser pamuser sudo passwd pamuser...