nooneknows2mao
New Member
I was trying to limit the command a specific user can execute in the sudoers file, say I have something like this:
My dummy user is only allowed to reboot or shut down the system. I intentionally allow the dummy user to impersonate other users, but anytime I try using the -u option of the sudo e.g
I get the following error:
I understand I can specifically call out the user and group I want to impersonate in the sudoers, but I am curious as to why the ALL:ALL doesn't work
I would greatly appreciate your answers.
Code:
dummy myserver=(ALL:ALL) /usr/sbin/reboot,/usr/sbin/shutdown
My dummy user is only allowed to reboot or shut down the system. I intentionally allow the dummy user to impersonate other users, but anytime I try using the -u option of the sudo e.g
sudo -u anotheruser whoami
I get the following error:
Code:
Sorry, user dummy is not allowed to execute '/usr/bin/whoami' as anotheruser on myserver.
I would greatly appreciate your answers.