This is getting more and more common, so I wanted to provide the steps required to get LDAP authentication working with MariaDB PAM plugin.
Unless you’re already familiar with setting up the MariaDB PAM plugin, I’d first recommend getting this to work with a standard Linux user (steps 1-4), then once all is working fine, progress to the LDAP users (steps 5-10). (And if you do not want to test this for the Linux user account, then you may skip steps #2 and #3.)
- Enable plugin by running the following from the command line
INSTALL SONAME 'auth_pam';
You should see an entry like this afterward in SHOW PLUGINS:
| pam | ACTIVE | AUTHENTICATION | auth_pam.so | GPL |
- Create the mysql user account (note it does not have a password, as it will obtain this from your Linux user, and eventually the LDAP account) and provide it with the GRANTS you want it to …