Would you like to learn how to configure the Radius 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 Radius protocol on a computer running Ubuntu Linux.

• Ubuntu 20.04
• Ubuntu 19.04
• Ubuntu 18.04
• MariaDB 10.3
• Freeradius 3.0.20

In our example, the Radius server IP address is 192.168.15.10.

In our example, the MariaDB server IP address is 192.168.15.11.

Tutorial – FreeRadius Server Installation on Ubuntu Linux

• IP – 192.168.15.10
• Operacional System – Ubuntu 20
• Hostname – FREERADIUS

Install the FreeRadius service.

Copy to Clipboard

Now, we need to add clients to the Radius configuration file.

Locate and edit the Radius clients configuration file.

Copy to Clipboard

Add the following lines at the end of the clients.conf file.

Copy to Clipboard

In our example, we are adding 1 client device:

The device was named MARIADB and has the IP address 192.168.15.11.

Now, we need to add FreeRadius users to the USERS configuration file.

Locate and edit the Freeradius users configuration file.

Copy to Clipboard

Add the following lines at the end of the file

Copy to Clipboard

Restart the Freeradius server.

Copy to Clipboard

You have finished the Freeradius installation on Ubuntu Linux.

Tutorial MariaDB – Radius authentication using Freeradius

• IP – 192.168.15.11
• Operacional System – Ubuntu 20
• Hostname – MARIADB

Install the required packages to enable the Radius authentication.

Copy to Clipboard

Edit the configuration file named pam_radius_auth.conf.

Copy to Clipboard

Here is the file, before our configuration.

Copy to Clipboard

Here is the file, after our configuration.

Copy to Clipboard

We performed the following configuration:

• Radius Server IP – 192.168.15.10
• Radius Secret – kamisama123

You need to change the IP address to your Freeradius server IP.

You need to change the Radius secret to your Radius secret.

Test your Radius authentication using the following command.

Copy to Clipboard

You need to change the IP address to your Freeradius server IP.

You need to change the Radius secret to your Radius secret.

You need to change the admin user account and the password 123qwe.. to reflect your user account.

Here is the command output:

Copy to Clipboard

Tutorial MariaDB – Radius authentication

• IP – 192.168.15.11
• Operacional System – Ubuntu 20
• Hostname – MARIADB

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 Radius account password.

Enable the MariaDB service to read the Radius file.

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 MariaDB account named ADMIN.

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 have finished the MariaDB service Radius authentication configuration.