cupsenable cupsdisable
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: Ope开发者_开发技巧ration failed: client-error-forbidden
I just needed to add the user to the lpadmin group. I was over thinking this.
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.
精彩评论