MariaDB user password complexity. Simple Password Check Plugin

  • Last update: Apr 3, 2024
  • Views: 72
  • Author: Admin
MariaDB user password complexity. Simple Password Check Plugin

Hello colleagues.

In today's article, I want to tell you about such a plug-in for MariaDB as Simple Password Check Plugin.

This plugin is used to specify password complexity for users so that users cannot specify a password that is too simple.

 

Article content:

  1. Checking installed plugins in MariaDB.
  2. Installing the Simple Password Check Plugin.
  3. View all existing plugin options.
  4. Descriptions of the parameters of the Simple Password Check Plugin.
  5. Editing plugin parameters in the console.
  6. Editing parameters in the database configuration file.
  7. Remove Simple Password Check Plugin.

 

1. Checking installed plugins in MariaDB.

Before we start installing the plugin, let's see the entire list of installed plugins in the database. There is a command to view:

mariadb> SHOW PLUGINS;

simple_password_check_plugin

This screenshot shows all installed plugins in the database, but our plugin is not in our list. Let's install it.


 

2. Installing the Simple Password Check Plugin.

There are two methods for installing this plugin.

The first method is to install the plugin using the command:

mariadb> INSTALL SONAME 'simple_password_check';

simple_password_check_plugin

 

The second way is to add the command to the MariaDB configuration file. The configuration file is located by default in the /etc/my.cnf.d directory with the name server.cnf.

simple_password_check_plugin


 

3. View all existing plugin options.

After installing the plugin, we can see how many parameters are used in this plugin, for this we will use the command in the console:

mariadb> show variables like '%simple_password%';

simple_password_check_plugin

As you can see, the plugin itself uses four parameters.


 

4. Descriptions of the parameters of the Simple Password Check Plugin.

  • simple_password_check_digits - Number of digits, default one digit.
  • simple_password_check_letters_same_case - Number of uppercase and lowercase letters, default one lowercase and uppercase letter.
  • simple_password_check_minimal_length - The length of the password itself, by default eight characters.
  • simple_password_check_other_characters - Number of special characters, default is one special character.

 

5. Editing plugin parameters in the console.

If you are not satisfied with the plugin parameters that are set by default, then they can be adjusted to suit your requirements. Let's set the maximum password length to 12 characters, for example.

mariadb> SET GLOBAL simple_password_check_minimal_length = 12;

simple_password_check_plugin

As a result of this action, we have changed the minimum password length.


 

6. Editing parameters in the database configuration file.

We can also change plugin parameters in the database configuration file itself.

$. vim /etc/my.cnf.d/server.cnf

simple_password_check_plugin

We restart the database.

$. service mariadb restart

 

simple_password_check_plugin

As a result of this action, we changed the minimum number of digits in the password to two.


 

7. Remove Simple Password Check Plugin.

If for some reason you no longer need the plugin, then you can easily remove it, for this we will use the command in the console:

mariadb> UNINSTALL SONAME 'simple_password_check';


 

Thank you all, I hope my article was of some help to you.

SIMILAR ARTICLES