首页 > 解决方案 > 在 perl 脚本 (cgi-bin) 中使用 `sudo grep syslog` 时权限被拒绝

问题描述

我的 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.

那么,有什么办法可以解决这个问题吗??

标签: perlsudocgi-bin

解决方案


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


推荐阅读