Would you like to learn how to configure the PAM authentication on the MariaDB server? In this tutorial, we are going to show you how to configure the MariaDB service to authenticate users using the Plugable Authentication module also known as PAM on a computer running Ubuntu Linux.

• Ubuntu 20.04
• Ubuntu 19.04
• Ubuntu 18.04
• MariaDB 10.3

Tutorial MariaDB – PAM Authentication

Install the MariaDB service.

Copy to Clipboard

Create the PAM configuration file.

Copy to Clipboard

Here is the file content.

Copy to Clipboard

In our example, we are going to authenticate the MariaDB service access using the local account passwords.

Enable the MariaDB service to read the SHADOW file.

Copy to Clipboard

Reboot the computer.

Copy to Clipboard

Create a local user account.

Copy to Clipboard

Access the MariaDB command-line.

Copy to Clipboard

Enable the PAM authentication plugin.

Copy to Clipboard

Create a new user account.

Copy to Clipboard

In our example, we create a user account named TEST1.

In our example, we configured this user account to authenticate using the PAM file named MARIADB.

Access the MariaDB command-line using the new account.

Copy to Clipboard

Verify the user account.

Copy to Clipboard

Here is the command output.

Copy to Clipboard

Congratulations! You finished the MariaDB service PAM authentication configuration.