How disable mysql command in sudoers file?
Posted
by
Carlos A. Junior
on Ask Ubuntu
See other posts from Ask Ubuntu
or by Carlos A. Junior
Published on 2012-11-12T15:36:43Z
Indexed on
2012/11/12
17:21 UTC
Read the original article
Hit count: 368
How i can disable /usr/bin/mysql command in sudoers file ? ... Actually I've tryed use with this way:
%tailonly ALL=!/usr/bin/mysql
But when i'm access if user 'tailonly' of group 'tailonly', this command still enabled.
In resume, i'm only want that 'tailonly' user access 'tail -f /usr/app/*.log' ...
This is possible ?
Edit:
With this config, the user 'tailonly' still can access mysql terminal with 'mysql' command:
$: sudo su
$: visudo
Cmnd_Alias MYSQL = /usr/bin/mysql
Cmnd_Alias TAIL=/usr/bin/tail -f /jacad/jacad3/logs/*.log
# User privilege specification
root ALL=(ALL:ALL) ALL
# Members of the admin group may gain root privileges
%admin ALL=(ALL) ALL
# Allow members of group sudo to execute any command
%sudo ALL=(ALL:ALL) ALL
%swa ALL=/etc/init.d/jacad3 stop
%swa ALL=/etc/init.d/jacad3 start
%swa ALL=/etc/init.d/jacad3 restart
%swa ALL=sudoedit /jacad/jacad3/bin/jacad_start.sh
%tailonly ALL=ALL,!MYSQL
© Ask Ubuntu or respective owner