I have one administrator account in my system which named as "admin". One more admin account called "test". I don't want test account to reset "admin" account and root account password in my system.
I have blocked sudo users by following command.
%sudo ALL=(ALL) ALL, !/usr/bin/passwd root,!/usr/bin/passwd admin admin ALL=(ALL:ALL) ALL
It's working on when executing this command as test user. If test user tries
sudo passwd root or
sudo passwd admin
It throws following error called
Sorry, user test is not allowed to execute '/usr/bin/passwd root' as root on magesh-test.
But it's not working while executing the following command
sudo passwd $root
How to block the test user alone in resetting the password?