MariaDB LDAP PAM 身份验证

时间:2021-03-24 07:41:46

标签: ldap mariadb pam

我的本​​地测试环境中有一个 Active Directory 和一个 MariaDB 服务器。现在我想让MariaDB下的AD用户登录成为可能。

我已经看过一些教程,这里有几乎所有关于它的主题。

我的/etc/nslc.conf:

    uid nslcd
    gid nslcd
    uri ldap://172.29.210.219/
    base dc=saptest,dc=local
    ldap_version 3
    binddn CN=bind,CN=Users,DC=SAPTEST,DC=LOCAL
    bindpw supersecurepassword
    ssl off
    filter passwd (objectClass=user)
    map passwd uid sAMAccountName

我的/etc/pam.d/mariadb

auth sufficient pam_ldap.so
account sufficient pam_ldap.so

我在 MariaDB 中的步骤

INSTALL SONAME 'auth_pam';
CREATE USER 'admin'@'%' IDENTIFIED VIA pam USING 'mariadb';
GRANT ALL ON *.* TO 'admin'@'%';
FLUSH PRIVILEGES;
EXIT;

当我执行“mysql -u admin -p”时出现以下错误:

ERROR 1045 (28000): Access denied for user 'admin'@'localhost' (using password: NO)

非常感谢。

0 个答案:

没有答案