[sudo-users] Help on sudoers and Runas_Alias
Ahamed
ahamed.en at gmail.com
Thu Jan 27 18:44:16 EST 2011
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 flx1208 2.6.21_mvlcge510-pc_target-x86_em64t-Malban10-cge5 #1
SMP PREEMPT RT Thu Nov 18 07:12:50 CST 2010 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
More information about the sudo-users
mailing list