Details
-
New Feature
-
Status: Closed (View Workflow)
-
Blocker
-
Resolution: Fixed
Description
There may be circumstances where it makes sense to disable the system command in the mysql client. See https://mariadb.com/kb/en/how-to-disable-system-command-on-mariadb-shell, https://stackoverflow.com/questions/40958372/how-to-make-the-system-command-unavailable-in-mysql and https://bugs.mysql.com/bug.php?id=26941 for a MySQL patch that was never implemented.
Attachments
Issue Links
- blocks
-
MDEV-33727 mariadb-dump trusts the server and does not validate the data
-
- Closed
-
- is duplicated by
-
MDEV-33682 Please provide a "secure mode" for the MariaDB Client.
-
- Closed
-
So, you want to have only system root access to mariadb root, and you configure /etc/sudoers so that other users will be able to run mysql client as root, but not any other commands?
Yes, in this case chroot approach will work and will do what you need.
A more database centric approach would be to create a role, say, "admin" and grant it to those users that you want to be root-like. Say,
After that, say, Tom will be able to login without a password as tom, and then he'll be able to set the admin role to do root stuff:
tom ~ $ mysql
MariaDB> SHOW BINARY LOGS;
ERROR ... permission denied to user `tom`@`localhost`
MariaDB> SET ROLE admin;
MariaDB> SHOW BINARY LOGS
+--------------------------+
...
That is, a user can login without a password as himself — just as you like. And then the user can assume the superuser role if needed, but can also work as non-superuser normally, so it doesn't mean that Tom becomes a superuser. Pretty much like you'd have with sudo and /etc/sudoers approach. But without a dangerous system root access.