Jump to content

sudo


Recommended Posts

Who is an sudo guru?

 

I want to enable users to sudo an application with only specific prameters

example:

 

whoami

paul

sudo ls ~paul

<insert dir listing here>

sudo ls ~tyme

paul isn't allowed to view ~tyme

 

Perhaps directories aren't the best example .. here's another:

 

whoami

paul

sudo /usr/bin/myscript -p -o -i -u -y 'paul'

script completed !!!

sudo /usr/bin/myscript -p -o -i -u -y 'tyme'

paul isn't allowed to run myscript with tyme as a parameter

 

how do I setup sudo to allow this?

 

I've tried the following

%users localhost= NOPASSWD: /usr/bin/myscript -p -o -i -u -y `whoami`

 

but it didn't seem to work :(

Link to comment
Share on other sites

only thing that immediately pops out at me is syntax...i.e.:

%users localhost= NOPASSWD: /usr/bin/myscript -p -o -i -u -y '`whoami`'

 

but perhaps you've tried that and i'm completely out of my wits...

Link to comment
Share on other sites

so far it looks like I have to go thru eachuser :cry:

paul localhost= NOPASSWD: /usr/bin/myscript -p -o -i -u -y paul

tyme localhost= NOPASSWD: /usr/bin/myscript -p -o -i -u -y tyme

 

I tried this with hope ...

%users localhost= NOPASSWD: /usr/bin/myscript -p -o -i -u -y %u

but to no avail

 

oh well .. I guess I document it so I do forget in the future :)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...