Limit Sudo to specific commands

Limit Sudo to specific commands

Limit Sudo to specific commands

In this scenario, we have SUDO already setup, howewever we want to be a bit more restrictive as to what can be run via sudo. Login, and su to root

the first thing we need to do is determine the full path of the binary we want to sudo user to have access to. The best way to do this is with the “whereis” command. In this case, we are lookin up yum

as we can see yum is stored in /usr/bin/yum

now edit the sudo config

in this case we are graning the “sudo” LDAP group with the capability of not having to enter a password, and ability to update via YUM using /usr/bin/yum binary.

That’s it!

Hosted Linux Servers at www.zwiegnet.com/go

Leave a Reply

Your email address will not be published. Required fields are marked *