sudo processes
potomak opened this issue · 7 comments
I'd like to run a process as super user. Is it possible for monu to ask credentials to run processes that need special permissions?
I actually have no idea how to implement this. I'm thinking if you launch Monu.app from the command line using 'sudo' it will inherit the sudoness for all spawned child processes, but even then i'm not sure that will work.
Ideally there would be some way to e.g. use Keychain to authenticate once and give permission to Monu to always spawn processes as sudo, but I have no idea how to do that or if that is possible
Me neither, I'm going to close this issue. Thanks anyway for your help.
No worries. I actually am gonna reopen just to see if anyone ever comes through with a suggestion of how they might implement this
@potomak You need to setup sudoers in order to allow to escalate rights without passing password.
So just run sudo visudo
in command line and add line at the end of file
YourUserName ALL = (root) /bin/commandToExecute
Then you can add to monu config sudo /bin/commandToExecute
and command is executed as super user. For more info see http://osxdaily.com/2014/02/06/add-user-sudoers-file-mac/
@elmariofredo I think you need also to add the tag NOPASSWD
.
@potomak yes you are right, totally forgot about it, so for others correct sudoers line is
YourUserName ALL = (root) NOPASSWD: /bin/commandToExecute