CUPS: silent authentication for printing
Solved
Hello everyone,
Under Buster, I'm looking for a solution to print with CUPS without having to provide a password every time. Under Windows, I just had to enter the credentials for the desired print port, and it wouldn't ask for a password during printing anymore.
For your information, for traceability purposes, each PC is authenticated by an account created on the CUPS server, and our printers are not directly visible; you have to go through the CUPS server redirected by the /etc/cups/client.conf file of each client with the ServerName directive and pre-filled during printing by the User directive.
How can I do the same under Debian?
With regards,
lnj
Under Buster, I'm looking for a solution to print with CUPS without having to provide a password every time. Under Windows, I just had to enter the credentials for the desired print port, and it wouldn't ask for a password during printing anymore.
For your information, for traceability purposes, each PC is authenticated by an account created on the CUPS server, and our printers are not directly visible; you have to go through the CUPS server redirected by the /etc/cups/client.conf file of each client with the ServerName directive and pre-filled during printing by the User directive.
How can I do the same under Debian?
With regards,
lnj
5 réponses
Hello,
I forgot to mention (but I can't modify the original message) that it's a network copier in a heterogeneous Windows/Linux park.
This is an important aspect of the question, as for me, you were talking about a local printer, e.g. connected via USB.
Prerequisites
Depending on the operating system running on the machine from which the printing must be initiated, the window that allows you to make this adjustment is hidden in different admin rights
CUPS: administration interface
To administer CUPS, you can use one of these two interfaces:
CUPS: authentication
In the chosen interface, you then need to add a network printer. To do this, you will need to authenticate to be an administrator in the sense of CUPS, thus with a login belonging to the
Example: on your machine, to administer CUPS, you can use the login
CUPS: declaring the printer
Once authenticated, you just have to declare the printer:
Of course, if the printer is already declared, you just need to correct its properties (right-click properties in
CUPS: printer connection parameters
As explained in this link, you simply need to adapt the printer's URI, whose general syntax is of the following form:
The "device-uri" will be of the form 'scheme://[username:password@]hostname[:port]/[resource]', where scheme may be "http", "https", "ipp", "lpd", "smb", or "socket" in the current implementation.
Example: for a printer accessed via IPP protocol, listening on port
Good luck
I forgot to mention (but I can't modify the original message) that it's a network copier in a heterogeneous Windows/Linux park.
This is an important aspect of the question, as for me, you were talking about a local printer, e.g. connected via USB.
Prerequisites
Depending on the operating system running on the machine from which the printing must be initiated, the window that allows you to make this adjustment is hidden in different admin rights
- If the machine is running Windows, you've already found it, so I'll skip it.
- If the client is using Linux, the declaration of a printer (networked or not) is done via CUPS. It may be useful to emphasize that CUPS is a server in the software sense, but nonetheless, the machine in question is a client of the printer in the network sense. In fact, CUPS is a kind of relay. In short, any Linux that wishes to print must have its CUPS, and in CUPS, the printer or printers concerned must be declared.
CUPS: administration interface
To administer CUPS, you can use one of these two interfaces:
- either directly in the CUPS web interface by connecting to http://localhost:631;
- or via
system-config-printer
(this is a graphical interface that allows you to configure CUPS).
CUPS: authentication
In the chosen interface, you then need to add a network printer. To do this, you will need to authenticate to be an administrator in the sense of CUPS, thus with a login belonging to the
lpadmingroup.
Example: on your machine, to administer CUPS, you can use the login
lnj(since it has been added to the lpadmin group) or of course,
rootwho has all rights.
CUPS: declaring the printer
Once authenticated, you just have to declare the printer:
- In CUPS: Administration > Add Printer > (choose the appropriate protocol).
- In
system-config-printer
: same principle.
Of course, if the printer is already declared, you just need to correct its properties (right-click properties in
system-config-printer).
CUPS: printer connection parameters
As explained in this link, you simply need to adapt the printer's URI, whose general syntax is of the following form:
The "device-uri" will be of the form 'scheme://[username:password@]hostname[:port]/[resource]', where scheme may be "http", "https", "ipp", "lpd", "smb", or "socket" in the current implementation.
Example: for a printer accessed via IPP protocol, listening on port
9100and whose IP address is
11.22.33.44, and for which we print as
paul, the URI would be:
ipp://paul@11.22.33.44:9100
Good luck
It's good, it's working :D
I started from scratch with a new and isolated CUPS installation, and I applied the same settings as on the existing CUPS in /etc/cups/cupsd.conf.
In the end, the URI with silent authentication that works to access CUPS (configured by default) is:
ipp://<user>:<mdp>@<serveur_cups>:631/printers/<imprimante>
ex: ipp://lnj:1234@cups.local:631/printers/KONICA_MINOLTA_C280
Note: with CUPS configured by default, printers are accessible here: http://localhost:631/printers
I tested on the already existing CUPS server... it worked, NO password prompt :)
I don't know why I couldn't get it to work before, but in the end, it helped me understand a lot about setting up CUPS. I'm also in the process of creating a tutorial/template for setting up mandatory authentication by CUPS (I'll make sure to come back when it's in place).
So thank you mamiemando and looking forward to it :)
Problem solved then
PS: I'm changing the title because I found a more suitable phrase
CUPS: no longer asking for a password when printing -> CUPS: silent authentication when printing
I started from scratch with a new and isolated CUPS installation, and I applied the same settings as on the existing CUPS in /etc/cups/cupsd.conf.
In the end, the URI with silent authentication that works to access CUPS (configured by default) is:
ipp://<user>:<mdp>@<serveur_cups>:631/printers/<imprimante>
ex: ipp://lnj:1234@cups.local:631/printers/KONICA_MINOLTA_C280
Note: with CUPS configured by default, printers are accessible here: http://localhost:631/printers
I tested on the already existing CUPS server... it worked, NO password prompt :)
I don't know why I couldn't get it to work before, but in the end, it helped me understand a lot about setting up CUPS. I'm also in the process of creating a tutorial/template for setting up mandatory authentication by CUPS (I'll make sure to come back when it's in place).
So thank you mamiemando and looking forward to it :)
Problem solved then
PS: I'm changing the title because I found a more suitable phrase
CUPS: no longer asking for a password when printing -> CUPS: silent authentication when printing
Hello,
I assume you are trying to print from some application (like LibreOffice).
Is your user in the
Example :
Assuming your login is
... then restart.
No one to help me?
Is my request unclear?
Another piece of advice: do not write in a discussion thread where you have not yet received a response, as your message will be less visible (someone might mistakenly believe that someone has already started responding to you).
Good luck.
I assume you are trying to print from some application (like LibreOffice).
Is your user in the
lpadmingroup (see the result of the
groupscommand, which you can type in a terminal).
Example :
(mando@aldur) (~) $ groups
mando voice cdrom floppy sudo audio dip video plugdev netdev bluetooth lpadmin scanner pulse pulse-access
Assuming your login is
toto:
sudo usermod -a -G lpadmin toto
... then restart.
No one to help me?
Is my request unclear?
Another piece of advice: do not write in a discussion thread where you have not yet received a response, as your message will be less visible (someone might mistakenly believe that someone has already started responding to you).
Good luck.
Hello mamiemando and thank you for giving me your time as you have in the past :)
I suppose you are trying to print from some application (like LibreOffice).
Yes, generally from office tools (LibreOffice, Thunderbird, Firefox, Evince, any text editor like Geany, Leafpad, Mousepad, ...) but also from drawing tools (The Gimp, Photoflare, and Photofiltre via Wine)
My user is already part of the lpadmin group and it still doesn't work, so there must be another prerequisite (or my installation is messed up)
By the way, can you give me your source regarding the need for belonging to the lpadmin group, because I have searched a lot on the internet (maybe poorly) but I find little information regarding printing with authentication on CUPS?
Another piece of advice: don't reply in a discussion thread where you haven't received a response yet, as your message will be less visible (one might wrongly think that someone has already started to respond to you).
Thanks for the advice, it's true that sometimes patience eludes me... After how much time do you find it appropriate to revive a thread?
I suppose you are trying to print from some application (like LibreOffice).
Yes, generally from office tools (LibreOffice, Thunderbird, Firefox, Evince, any text editor like Geany, Leafpad, Mousepad, ...) but also from drawing tools (The Gimp, Photoflare, and Photofiltre via Wine)
My user is already part of the lpadmin group and it still doesn't work, so there must be another prerequisite (or my installation is messed up)
By the way, can you give me your source regarding the need for belonging to the lpadmin group, because I have searched a lot on the internet (maybe poorly) but I find little information regarding printing with authentication on CUPS?
Another piece of advice: don't reply in a discussion thread where you haven't received a response yet, as your message will be less visible (one might wrongly think that someone has already started to respond to you).
Thanks for the advice, it's true that sometimes patience eludes me... After how much time do you find it appropriate to revive a thread?
Hello lenainjaune,
Thank you for giving me your time as you have in the past :)
You're welcome ;-)
My user is already part of the lpadmin group and it's not working, so there must be another prerequisite (or maybe my installation is messed up)
Have you thought about restarting or logging back in?
By the way, can you provide me with your source regarding the need to belong to the lpadmin group, as I’ve searched a lot on the internet (maybe poorly) but find little information regarding printing with authentication on CUPS?
Yes:
Can you confirm that your user is indeed a member of the
Thanks for the advice, it’s true that sometimes patience is lacking for me... After how long do you think it’s appropriate to bump a thread?
Well, in the case of the Linux forum, I would say never, because that’s the best way for me to miss it! Indeed, every time I pass by, I try to respond to people who haven’t yet received an answer.
Thank you for giving me your time as you have in the past :)
You're welcome ;-)
My user is already part of the lpadmin group and it's not working, so there must be another prerequisite (or maybe my installation is messed up)
Have you thought about restarting or logging back in?
By the way, can you provide me with your source regarding the need to belong to the lpadmin group, as I’ve searched a lot on the internet (maybe poorly) but find little information regarding printing with authentication on CUPS?
Yes:
- https://wiki.debian.org/SystemGroups
- https://unix.stackexchange.com/questions/551372/stop-asking-for-admin-sudo-password-in-print-settings-dialog
Can you confirm that your user is indeed a member of the
lpadmingroup with the command
groups?
Thanks for the advice, it’s true that sometimes patience is lacking for me... After how long do you think it’s appropriate to bump a thread?
Well, in the case of the Linux forum, I would say never, because that’s the best way for me to miss it! Indeed, every time I pass by, I try to respond to people who haven’t yet received an answer.
I forgot to mention (but I can't modify the original message) that it's a network printer in a heterogeneous Windows/Linux park.
Have you thought about restarting or logging back in?
Yes, of course ;)
Can you confirm that your user is indeed a member of the lpadmin group with the command groups?
Well, in the case of the Linux forum, I would say never, because that's the best way for me to miss something! Indeed, every time I pass by, I try to respond to people who haven't received an answer yet.
Wow! I'm impressed that some volunteers have this approach. A big thank you for your involvement (especially in a volunteer capacity) and for taking the time to write real sentences. Much respect :D
However, I feel like we are not talking about the same thing...
From the link Debian doc: lpadmin (LPADMIN): Allows members to manage printers and pending jobs sent by other users.
In the language of Molière: "Allows members to manage printers and pending jobs sent by other users."
That's not my case; I'm neither looking to manage printers nor the jobs of other users.
What I want on a network printer is for my print job to be authenticated and then logged (today Paul printed 10 pages in color). As it stands, it works very well: from his session, Paul requests to print a document, the client.conf file pre-fills the user field in the popup that appears:
He just has to enter his password to authenticate that it is indeed him ... and it prints. But if he has 50 prints to do, he will have to enter his password 50 times before confirming each print (it's a bit cumbersome).
What I'm looking for is a way to provide the password without him having to type it. Under Windows, this is done simply in the printer port configuration (as here under Windows 10):
Have you thought about restarting or logging back in?
Yes, of course ;)
Can you confirm that your user is indeed a member of the lpadmin group with the command groups?
lnj@host:~$ groups lnj cdrom floppy sudo audio dip video plugdev netdev libvirt lpadmin wireshark libvirt-qemu
Well, in the case of the Linux forum, I would say never, because that's the best way for me to miss something! Indeed, every time I pass by, I try to respond to people who haven't received an answer yet.
Wow! I'm impressed that some volunteers have this approach. A big thank you for your involvement (especially in a volunteer capacity) and for taking the time to write real sentences. Much respect :D
However, I feel like we are not talking about the same thing...
From the link Debian doc: lpadmin (LPADMIN): Allows members to manage printers and pending jobs sent by other users.
In the language of Molière: "Allows members to manage printers and pending jobs sent by other users."
That's not my case; I'm neither looking to manage printers nor the jobs of other users.
What I want on a network printer is for my print job to be authenticated and then logged (today Paul printed 10 pages in color). As it stands, it works very well: from his session, Paul requests to print a document, the client.conf file pre-fills the user field in the popup that appears:
He just has to enter his password to authenticate that it is indeed him ... and it prints. But if he has 50 prints to do, he will have to enter his password 50 times before confirming each print (it's a bit cumbersome).
What I'm looking for is a way to provide the password without him having to type it. Under Windows, this is done simply in the printer port configuration (as here under Windows 10):
Hello the yellow dwarf,
First of all, congratulations! It's great to see that everything is working as you hoped and especially to see that you've learned a lot (I’ve learned some things too as I've never faced this issue before). Great job renaming the title, I mark the issue as resolved.
Best of luck :-)
First of all, congratulations! It's great to see that everything is working as you hoped and especially to see that you've learned a lot (I’ve learned some things too as I've never faced this issue before). Great job renaming the title, I mark the issue as resolved.
Best of luck :-)
I spent all of yesterday researching (and translating), searching, and testing ... but with little result.
To simplify my life, I used the command
The only thing I managed to achieve was printing only from Geany but NOT from LibreOffice Writer (strange) with the backend dnssd (Protocol Bonjour), here's the command:
However, the password prompt was still there; apparently, it didn't change anything, and when I tried to test it again, it didn't work this time.
Why did I test this URI with the backend dnssd? Because it was part of those returned by
I can't find any documentation or tutorial to set up a CUPS server with authentication for printing. I wasn't the one who set it up.
I would also like to trace/debug what's happening when I print to see where the problem is. For now, I've just looked at the /var/log/cups but didn't see anything particular. I will need to take another look.
So that's where I am!
In the meantime, I found this discussion which seems like an interesting lead. Have you tested it?
Good luck
After that, it's another issue...