sudo in php exec()

后端 未结 7 1268
执笔经年
执笔经年 2020-11-22 09:44

I don\'t know what the deal is here…

So I want to run an applescript: sudo osascript myscript.scpt

This works fine in the terminal, but not when

7条回答
  •  感动是毒
    2020-11-22 10:47

    It sounds like you need to set up passwordless sudo. Try:

    %admin ALL=(ALL) NOPASSWD: osascript myscript.scpt
    

    Also comment out the following line (in /etc/sudoers via visudo), if it is there:

    Defaults    requiretty
    

提交回复
热议问题