How can I add an user to sudoers list with all privileges, but that user should not be able to edit the sudoers file ?
1 Answer
Edit the sudoers with the visudo command
sudo visudo
Add the user like this
theusername ALL=ALL, !/usr/sbin/visudo
Which will explicit disallow the user from running the visudo command with sudo.
However, this does not prevent them from running
sudo -s
to drop to a root shell, from which they can run the visudo command.
-
-
Or prevent him from editing
/ect/sudoers
with regular vim (or any other texteditor). I don't think there's any solution you would be happy with, because you're asking for contraditory things. Jun 27, 2012 at 9:08
/me scratches head