2

I want to allow the execution of a mount script for everybody. I'm usually working with a domain user. While allowing the usage of sudo for my user works, I can't disable the password prompt for a certain command.

My sudoers file is unmodified, except for an additional line at the end:

%domain^users ALL = PASSWD: ALL, NOPASSWD:/usr/local/bin/mount_synology

I executed sudo -k to delete cached credentials, then I tried /usr/local/bin/mount_synology but I still get a password prompt. Any idea what's wrong? Also, how would I go about adding multiple allowed commands?

2
  • Does your script call another program that requires superuser privileges (such as mount) ? Perhaps adding all users to a group that has permissions would be better.
    – Ian B.
    Aug 4, 2012 at 16:22
  • @IanB. Found the problem, shouldn't have used sudo for the mount command inside the script :)
    – Ahatius
    Aug 4, 2012 at 16:28

1 Answer 1

2

Ok, I found the problem (should have posted the contents of the script itself, that would have helped).

Sudoing the mount_synology didn't issue the password prompt. It was the sudo mount inside the script. But since I call the script with sudo there was no need to sudo the mount command.

After removing the sudo in the script, it worked :)

You must log in to answer this question.

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