Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

Sidekick is a helpful little tool which adjusts the system settings based on geographical location.

I added an action which will execute a sudo command-line command. The problem is that the Terminal pops up and asks me for the password. Is there a way to allow Sidekick to execute sudo without asking for a password?

share|improve this question
1  
The real question is, do you really want to? sudo requires a password after regular intervals for a good reason. gratisoft.us/sudo/sudo.man.html –  Blazemonger Oct 28 '11 at 18:46
    
I want to enable and disable some sharing settings: turning file, web sharing and remote management on and off. This is possible without a password anyways via System Preferences. Sadly this is not supported by AppleScript. –  mcb Oct 28 '11 at 18:49

1 Answer 1

up vote 3 down vote accepted

You can disable password prompt when calling sudo in combination with certain commands by editing the sudoers file. This is done by opening a terminal and running sudo visudo. You have to add the follwing lines

Cmnd_Alias SIDEKICK_CMDS = /full/path/to/the/command1,  /full/path/to/the/command2

yourUsername ALL=(ALL) NOPASSWD: SIDEKICK_CMDS

Be careful with this, as it may lead to security risks. It enables anyone logged in with your account ( so not just sidekick) to run the commands in the list without a password prompt.

For a full description of the sudoers options check the manpage : man sudoers

share|improve this answer

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.