Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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?

share|improve this question
    
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 '12 at 16:22
    
@IanB. Found the problem, shouldn't have used sudo for the mount command inside the script :) –  Ahatius Aug 4 '12 at 16:28
add comment

1 Answer

up vote 2 down vote accepted

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 :)

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.