Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am trying to let user2 run a particular script - that belongs to user1 and allow him(user2) to run as the script's owner, user1. So I made an entry in the /etc/sudoers file, however visudo shows an error, but doesnt specify. Here is what I have-

#User priveilege specification
root ALL=(ALL) ALL

#The following line gives an error
user2 ALL=(user1) /home/user1/bin/

OS: Ubuntu 10.4

share|improve this question
Do both users actually exist in in /etc/passwd? Check for any errant leading/trailing slashes or uncommented lines? – Garrett Nov 15 '11 at 3:58
I did. There doesnt seem to be any syntax errors I can spot. Will get other people to look at it so I can be sure. Thanks for looking @gman – sri Nov 15 '11 at 4:31
up vote 1 down vote accepted

Well, I would say to create a new group and add the users (user1 and user2) to that new group.

After that you would add up the below entry on the sudoers.

newgroup ALL=(ALL) /home/user1/bin/


share|improve this answer
Are you sure? Looks like both users will then be able to impersonate any other user when running that script which can be edited by at least one of them. I.e. a really bad idea. – Daniel Beck Nov 18 '11 at 7:12

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .