0

I'm running mariadb 10.2 in ubuntu 16.04. The mariadb will perform external authentication using freeipa (ldap+kerberos). I can connect mariadb server with mariadb client, using freeipa credential. Everything work as usual. The /etc/pam.d/mariadb as below:

auth required pam_unix.so 
account required pam_unix.so 
auth required pam_user_map.so

However, when I'm connect using php7 mysqli (command line or web), it return:

(
    [affected_rows] => 
    [client_info] => 
    [client_version] => 50012
    [connect_errno] => 2054
    [connect_error] => The server requested authentication method unknown to the client
    [errno] => 
    [error] => 
    [error_list] => 
    [field_count] => 
    [host_info] => 
    [info] => 
    [insert_id] => 
    [server_info] => 
    [server_version] => 
    [stat] => 
    [sqlstate] => 
    [protocol_version] => 
    [thread_id] => 
    [warning_count] => 
)

From lot of research I'm notice that php mysql driver doesn't support PAM authentication well. There is online resources http://www.sheeri.org/ldap-with-auth_pam-and-php/ tell me that there is a way to overcome it, but it too rough. Can somebody tell me how to rebuild for ubuntu with libmariadbclient? I can't find /usr/bin/mysql_config anyway. Thanks

Ks Tan
  • 3
  • 3

1 Answers1

0

I'd greatly simplified the solution, I'd create basic bash script for ubuntu. It will use default apache2/php/percona server/client by only override mysqli.so, pdo_mysql.so.

https://gist.github.com/kstan79/367ef928e44523904fb36b67a92decdd

Ks Tan
  • 3
  • 3