Operating System - Linux
1822496 Members
2929 Online
109642 Solutions
New Discussion юеВ

how to set up sudoers to for mass of scripts

 
Don Beethe
Occasional Advisor

how to set up sudoers to for mass of scripts

How do I setup sudo to allow a user to run any script in a directory?
From what I have been able to find via google, should be able to use:
/usr/local/scripts/ and allow user to run any script in that directory, but when I try this, I get:
Sorry, user db55621 is not allowed to execute /usr/local/scripts/testThis as lzMntIt1 on eagle1.rmtc.fedex.com

What do I have wrong here?
4 REPLIES 4
Heironimus
Honored Contributor

Re: how to set up sudoers to for mass of scripts

Using the directory in the sudoers file is the correct way to do that, but you probably need to post a non-working entry (sanitized as appropriate) for people to be able to give you much help.
Don Beethe
Occasional Advisor

Re: how to set up sudoers to for mass of scripts

db55621 ALL = (lzMntIt1) /opt/fedex/lzMntIt1/testing/scripts/

In /opt/fedex/lzWebIt1/testing/scripts/, there are scripts like startLssi, which runs some commands to start the app... If I try to do sudo -u lzMntIt1 /opt/fedex/lzMntIt1/testing/scripts/startLssi, I get the not allowed to excute.
VK2COT
Honored Contributor

Re: how to set up sudoers to for mass of scripts

Hello,

This should work fine. You can use wildcard
characters in sudoers file:

db55621 ALL = (lzMntIt1) /opt/fedex/lzMntIt1/testing/scripts/*

I tested similar command in Fedora 8 five minutes ago :)

Greetings from rainy Sydney,

VK2COT
VK2COT - Dusan Baljevic
Don Beethe
Occasional Advisor

Re: how to set up sudoers to for mass of scripts

That's what I thought. It even talks about doing exactly this in the sudoers manpage, but it refuses to work. Seems to be only the ixSudo version...