LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   user privilege specification (https://www.linuxquestions.org/questions/linux-newbie-8/user-privilege-specification-4175693388/)

Danielb630 04-09-2021 07:32 AM

user privilege specification
 
hey all,
i am using centos 7.9 and I'm trying to give a specific user the permission to run a specific bash script as root under his home directory,
i tried to add this
Quote:

kobol ALL=(ALL) NOPASSWD: /home/kobol/test1.sh
to /etc/sudoers.d with no success

Turbocapitalist 04-09-2021 07:38 AM

It should be something like this:

Code:

%kobol ALL=(root:root) NOPASSWD: /usr/local/bin/test1.sh ""
Where the script /usr/local/bin/test1.sh is readable and executable by kobol but not writable. The reason for that is to prevent the account kobol from writing their own passport to the system by permanently or temporarily modifying the script and running it with elevated privileges.


All times are GMT -5. The time now is 04:39 PM.