了shell_exec()还没有重新启动

问题描述:

我尝试通过例如使用了shell_exec()从我的PHP Web应用程序的简单commandes“LS”的作品,但使用sudo没有工作许可/关机树莓派:了shell_exec()还没有重新启动

了shell_exec (“sudo reboot”);

这是链接:

http://192.168.1.8/controle/webshell.php?commande=sudo%20reboot

但COMMANDE无法执行。

任何帮助?

+0

不SUDO询问密码? – RiggsFolly

+1

在askubuntu上查看[此问题](https://askubuntu.com/questions/159007/how-do-i-run-specific-sudo-commands-without-a-password)。您需要首先找出您的Web服务器正在运行的用户。 – rickdenhaan

它的工作原理与此修改在/ etc/sudoers文件:

www数据ALL = NOPASSWD:/ sbin目录/重启,/ sbin目录/停止