[MDEV-21396] Cannot specify multiple authentication plugins (mysql_native_password and unix_socket) Created: 2019-12-25 Updated: 2020-03-12 Resolved: 2019-12-25 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Authentication and Privilege System |
| Fix Version/s: | N/A |
| Type: | Task | Priority: | Major |
| Reporter: | Reinis Adovics | Assignee: | Unassigned |
| Resolution: | Not a Bug | Votes: | 0 |
| Labels: | None | ||
| Issue Links: |
|
||||||||
| Description |
ResolvedPlease see comment, my mistake, can be closed. Pardon! The environment
MariaDB was installed from the MariaDB repository root user is set to use unix_socket auth by running mariadb-secure-installation with params
ReferenceMariaDB documentation for CREATE USER states that One can specify many authentication plugins, they all works as alternatives ways of authenticating a user.
The issueBase
All unix_socket'ish login attempts fail
Using password (testpass) works
Extra observation 1If testuser at this point is altered to use unix_socket auth explicitly...
...then login no longer works on BOTH methods
Extra observation 2If testuser at this point is altered to use mysql_native_password auth explicitly...
...then using password (testpass) works (again)
Expected behaviourIf the documentation is correct, then 1) IDENTIFIED VIA mysql_native_password USING PASSWORD('testpass') OR unix_socket should yield ability to log in via both methods
2) Explicit ALTER USER testuser@localhost IDENTIFIED VIA unix_socket should yield ability to log in via unix_socket
Thanks in advance! |
| Comments |
| Comment by Reinis Adovics [ 2019-12-25 ] | ||
|
The issue was that although there is a testuser on the system, login to unix_socket was done using elevated perms which is incorrect as it messes up username-uid relation (caller is not testuser any more, but root). Calling
or
works. Pardon for the false alarm, it sometime takes ticket, to finally figure it out. | ||
| Comment by Elena Stepanova [ 2019-12-25 ] | ||
|
Right. And you shouldn't even need to provide -u testuser, it will attempt to login with the unix username (which is the point). Also, regarding the observation about mysql.user not showing multiple authentication methods – mysql.user is now a view maintained for backward compatibility with existing tools and scripts. It has its limitations, one of which is that it cannot show multiple auth methods. Full information is available in mysql.global_priv table. | ||
| Comment by Geoff Montee (Inactive) [ 2020-03-12 ] | ||
|
The issue mentioned in kroko's comment was probably caused by |