perl - 在 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.
那么,有什么办法可以解决这个问题吗??
解决方案
您应该使用 NOPASSWD 将 apache/nginx 用户添加到 sudoers 才能工作(不太推荐)
推荐阅读
- javascript - JS 输出未显示在 id 标签中
- python - SettingWithCopyWarning:转换列表
- javascript - Ionic-React 访问移动设备的本地存储
- sql - 仅显示具有连续覆盖的记录
- javascript - javascript 正则表达式最多 12 个小数位和 2 个浮点数
- c - 不兼容的指针类型结构节点到节点
- angular - Power BI 与 Spring Angular 的集成
- android - MediaStore 无法在 Kotlin 中列出手机内的所有视频。为什么?
- deep-learning - 在 deeplearning4j 中创建具有多个标签和未知数量类的 DataSet
- reactjs - Ant Design Notification 未在 React App 中使用自定义样式