cupsenable cups禁用

发布于 2024-12-06 17:55:11 字数 286 浏览 7 评论 0原文

我有一个作为 www-data 运行的 Web 应用程序。我需要让该用户可以访问 cupsenable 和 cupsdisable 。它是一个未连接到互联网并运行小型内部应用程序的服务器,我需要能够让用户能够重新启用打印机。

我已经使可执行文件权限世界可执行。

测试用...

sudo -u www-data /usr/sbin/cupsenable laser_01
cupsenable: Operation failed: client-error-forbidden

I have a web application that is run as www-data. I need to have cupsenable and cupsdisable accessible for that user. Its a server that isn't connected to the internet and is running a small internal application and i NEED to be able to give the users the ability to re-enable a printer.

I have already made the executables permissions world executable.

Testing with ...

sudo -u www-data /usr/sbin/cupsenable laser_01
cupsenable: Operation failed: client-error-forbidden

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

东北女汉子 2024-12-13 17:55:11

我只需要将用户添加到 lpadmin 组即可。我想多了。

I just needed to add the user to the lpadmin group. I was over thinking this.

病女 2024-12-13 17:55:11

看来您的执行权限没有问题。您必须获得许可才能使用杯子。所以仅仅修改你的 sudo 规则是不够的。事实上,在正确配置杯子后,我回滚了 sudo 修改。

尝试编辑 /etc/cups/cups-files.conf:
您可以定义一个系统组。此处添加的所有组均与 cupsd.conf 中的策略规则 @SYSTEM 匹配。
在此处添加您的用户组并重新启动 cups。

  • 找出您的用户 www-data 的组。
  • 然后将其添加到 cups.files.conf 中的 SystemGroup(以空格分隔)中。
  • 重新启动杯子。

这对我有用。

It seems like you don't have a problem with the execute-permissions. You must be permitted to administrate cups. So it isn't enough to modify your sudo-rules. In fact i rolled back my sudo-modifications after configuring cups correctly.

Try to edit your /etc/cups/cups-files.conf:
You can define a SystemGroup. All groups added here match the policy rules @SYSTEM in cupsd.conf.
Add the group(s) of your user(s) here and restart cups.

  • Find out the group of your user www-data.
  • Then add it, seperated by whitespace, to the SystemGroup in your cups.files.conf.
  • Restart cups.

That worked for me.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文