Hi All,
Thank you for your time. Request you to help with the sudoers issue I am facing.
I am trying to make use of Runas_Alias feature of sudoers. Some how I am not able to. Hope someone can help me. Thanks in advance.
I want the script /app2/run to be run as user "operator" when executed by the user engg. The /app2/run is just a sample script with "id" command in it for testing purpose. Anyways, here is the contents
Code:
$ cat run
#!/bin/ksh
echo "-----------------------------------------------"
id
echo "-----------------------------------------------"
In /etc/sudoers, I have the following entry
Code:
#
Runas_Alias OP=operator
engg ALL = (OP) NOPASSWD: /app2/run
I executed it using the -u option but no luck. I also tried giving the uid instead of username.
Code:
$ sudo -u operator ./run
sudo: unable to execute /app2/run: Permission denied
Is there anything I am doing wrong?
Here is my unix box version
Code:
$ uname -a
Linux x86_64 GNU/Linux
Normal sudoers works, I mean if I have entry like
Code:
engg ALL = NOPASSWD: /app2/run
And on execution
Code:
$ sudo ./run
-----------------------------------------------
uid=0(root) gid=0(root) groups=0(root),1(bin),2(daemon),4(adm)
-----------------------------------------------
Thank You,
Ahamed