I want to prevent users using "sudo rm" form anywhere.
I have edited sudoers:
Members of the admin group may gain root privileges
%admin ALL=(ALL) ALL,!/bin/rm
And ok:
derek@derek-desktop:~$ sudo rm
Sorry, user derek is not allowed to execute '/bin/rm' as root on derek-desktop.
But I create a test.sh with a rm command
derek@derek-desktop:~$ cat test.sh
rm --help
It show me the rm help.
Seems sudoers can't prevent this behavior. I want to disable all the users running rm from sudo.
Can you help me? Thanks in advance!