在 perl 脚本 (cgi-bin) 中使用 `sudo grep syslog` 时权限被拒绝

permission denied when using `sudo grep syslog` inside perl script (cgi-bin)

我的 cgi-bin 文件夹中有 perl 脚本,我想要的是使用 sudo grep 的 grep syslog(因为它是 root),但我收到了这条消息

我们相信您已经收到了本地系统的常规讲座 行政人员。它通常归结为这三件事:

#1) Respect the privacy of others.
#2) Think before you type.
#3) With great power comes great responsibility.

所以,有解决这个问题的方法吗??

您应该使用 NOPASSWD 将 apache/nginx 用户添加到 sudoers 才能工作(不太推荐)