Is it possible to prevent users to modify printer options in CUPS?
Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Is it possible to prevent users to modify printer options in CUPS?
A small family setup...
I have a color printer, and a Linux computer, with CUPS installed. I wan to allow the kids to print, but only in draft mode, and only in greyscale.
With CUPS I prevented the kids' account from accessing the printer. Then I set up a second printer, for the same hardware printer, but with different default options (draft and greyscale), and allowed the kids to access this new printer.
It works, when they print the default options for this new printer are indeed draft and greyscale. But they are just that, default options. They can change it.
Is there a way to prevent users from changing the options of a printer ?
My guess (never done it): when logged into the linux pc, the username used by the kids should not have the permission https://community.kde.org/Printing/CUPS/Access_Control
(all my pcs home has lpadmin group access and I dont have user restrictions; however I would look at the link and try it.. if I were you).
@floppy_stuttgart : no, even non-members of lpadmin can change the print options before printing
Access Control is binary : either a user has access to a printer, or he doesn't. Access Control doesn't permit control what options of a printer a user has access to (no fine grained control).
Last edited by stoorky; 02-19-2021 at 04:38 AM.
Reason: add info
@computersavvy : same answer as given to @floppy_stuttgart. CUPS policies are binary, either you allow access to a print queue, or you don't. No fine grained control there. Thus, it can not be used to enforce specific print options.
With CUPS I prevented the kids' account from accessing the printer. Then I set up a second printer, for the same hardware printer, but with different default options (draft and greyscale), and allowed the kids to access this new printer.
For this second printer config, modify the ppd for that config so that only draft and greyscale output is possible (ie strip out the unwanted options).
For this second printer config, modify the ppd for that config so that only draft and greyscale output is possible (ie strip out the unwanted options).
Thanks. Yes that's probably the way to go. I also just fell upon the Tea4CUPS project, which seems to provide a way to override options just before sending the job out to the printer.
A question which is sometimes seen concerns wanting to enforce default printer settings for applications and printing from the command line. It might be because some users on a network don't have the patience to check their printer settings or maybe it is seen as desirable to limit the alteration of some settings on an expensive-to-run colour printer. Within CUPS there is no surefire way of achieving this; a user is either allowed to print or not print.
Thanks for sharing those links re Tea4CUPS. Let us know how you get on.
I probably won't test Tea4CUPS. I just tested your idea (modifying the PPD). It's really straightforward and works perfectly, all I had to do is modifying /etc/cups/ppd/myDRAFTprinter.ppd and comment the "*OpenUI *ColorModel/Output Mode: PickOne" and "*OpenUI *OutputMode/Print Quality: PickOne " sections.
It works perfectly !
Only funny thing is, LibreOffice still shows the color and print mode option lists (but gray/draft is enforced, no matter what options the user chooses in LibreOffice). Other applications like Firefox don't show color and output mode dialogs anymore, as expected. I think it's due to the fact that LibreOffice does its own thing to build its print dialogs, it doesn't use GTK's standard print dialog. It's color options and output modes are probably hard-coded somewhere.
Anyway, it works, even with LibreOffice, the printer is now a "gray only draft printer" !
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.