# MariaDB auth\_pam.so plugin with winbind

**URL:** <https://forums.suse.com/t/mariadb-auth-pam-so-plugin-with-winbind/32285>\
**Category:** SLES Configure-Administer\
**Created:** [April 16, 2018, 10:57pm UTC](https://forums.suse.com/t/mariadb-auth-pam-so-plugin-with-winbind/32285 "2018-04-16T22:57:52Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![djmcdon1](https://avatars.discourse-cdn.com/v4/letter/d/9e8a1a/32.png) [@djmcdon1](https://forums.suse.com/u/djmcdon1)\
**Post date:** [April 16, 2018, 10:57pm UTC](https://forums.suse.com/t/mariadb-auth-pam-so-plugin-with-winbind/32285/1 "2018-04-16T22:57:52Z")

</div>

I’m trying to authenticate mariadb against winbind in Sles 12 SP3. I’ve created a new pam.d entry for mysql:  
:~\> cat /etc/pam.d/mysql  
#%PAM-1.0  
account required pam\_winbind.so use\_first\_pass   
password sufficient pam\_winbind.so

Originally I referenced common-account and common-password, but since I only want winbind accounts I copied just those entries

I’ve configured mariadb to load the auth\_pam.so module, and it shows up as active:  
:~\> sudo cat /etc/my.cnf.d/default\_plugins.cnf  
[server]  
#plugin-load-add=blackhole=ha\_blackhole.so  
#plugin-load-add=federated=ha\_federated.so  
#plugin-load-add=archive=ha\_archive.so  
[mysqld]  
plugin-load-add=auth\_pam.so  
MariaDB [mysql]\> show plugins;  
±----------------------------±-------±-------------------±------------±--------+  
| Name | Status | Type | Library | License |  
±----------------------------±-------±-------------------±------------±--------+  
| binlog | ACTIVE | STORAGE ENGINE | NULL | GPL |  
| mysql\_native\_password | ACTIVE | AUTHENTICATION | NULL | GPL |  
| mysql\_old\_password | ACTIVE | AUTHENTICATION | NULL | GPL |  
…  
| pam | ACTIVE | AUTHENTICATION | auth\_pam.so | GPL |  
±----------------------------±-------±-------------------±------------±--------+  
44 rows in set (0.00 sec)

I’ve created a user that references the plugin:  
MariaDB [mysql]\> show grants for ‘mumble’@‘localhost’;  
±---------------------------------------------------------------------------+  
| Grants for mumble@localhost |  
±---------------------------------------------------------------------------+  
| GRANT ALL PRIVILEGES ON _._ TO ‘mumble’@‘localhost’ IDENTIFIED VIA pam |  
±---------------------------------------------------------------------------+

The user can log in via ssh, but not to mariadb:  
:~\> mysql -p  
Enter password:  
ERROR 1045 (28000): Access denied for user ‘mumble’@‘localhost’ (using password: NO)

I don’t know why it says “using password: NO” rather than “: YES”, as I am clearly referencing a valid user. I’ve tried it with the “via PAM” clause both uppercase and lowercase.

Can anyone give me any hints where I might be messing up?

---

<div class="post-metadata">

**Author:** ![djmcdon1](https://avatars.discourse-cdn.com/v4/letter/d/9e8a1a/32.png) [@djmcdon1](https://forums.suse.com/u/djmcdon1)\
**Post date:** [April 17, 2018, 4:21pm UTC](https://forums.suse.com/t/mariadb-auth-pam-so-plugin-with-winbind/32285/2 "2018-04-17T16:21:37Z")

</div>

Apparently, pam needs the auth and session stanzas as well.

> cat /etc/pam.d/mysql  
> #%PAM-1.0  
> account required pam\_winbind.so  
> auth required pam\_winbind.so  
> session required pam\_winbind.so  
> password required pam\_winbind.so   
> mysql -p mrtg  
> Enter password:  
> Reading table information for completion of table and column names  
> You can turn off this feature to get a quicker startup with -A

Welcome to the MariaDB monitor. Commands end with ; or \g.  
Your MariaDB connection id is 12  
Server version: 10.0.34-MariaDB SLE 12 SP1 package

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the current input statement.

MariaDB [mrtg]\> quit  
Bye
