Use different username on CUPS remote printing
Solution 1
The issue has been reported as a bug (856776) and is now on the wishlist.
Solution 2
According to the man page https://www.cups.org/doc/man-client.conf.html, a User
directive could be placed in /etc/cups/client.conf
or ~/.cups/client.conf
However, this didn't work for me in Kubuntu Trusty.
What worked, was to export the CUPS_USER
environment variable by adding the following line in ~/.profile
:
export CUPS_USER=vangelis
Needless to say (but I say), that you need to change vangelis
to the username you would like to use.
You also need to restart your system so that the changes take effect in the desktop environment!
This information can be found at CUPS 1.6b1 release notes here: https://www.cups.org/blog.html (search for CUPS_USER)
Solution 3
This works for our system. Tested in Ubuntu 10.04 - 14.04, Linux Mint Print server Canon Uniflow, secure printing
First, stop cups
sudo service cups stop
Then edit the file /etc/cups/printers.conf
and add your username to the DeviceURI
like this:
DeviceURI lpd://[email protected]/our_printqueue
Now start cups again
sudo service cups start
However, be aware that this setting effects all users on this machine.
Solution 4
Always a bit late re. the original question, but the solution that worked for me in 2018 (and on Debian, but I assume the procedure is similar) is to edit, as root, the file /etc/cups/printers.conf, and to add the directive User official-user-from-printer's-pov in the printer part. Too bad I couldn't find it on the shiny cups admin interface...
Solution 5
You could use the username in the IPP URI when adding the printer queue, see this document for details:
http://www.cups.org/documentation.php/network.html
Otherwise I can see no options in cups or gnome print dialogs to help you select a username for printing.
Related videos on Youtube
jonallard
Updated on September 18, 2022Comments
-
jonallard almost 2 years
I'm using CUPS to print on an enterprise network. The job gets submitted fine, but I need to submit it as another username. Now I'm
jon
but I need to send it as sayjonallard
.On the command line, one could print as such
lp -U jonallard -d printer1 file.ext
How do I customize the username part when using the GUI printing dialogs and the Printing system settings?
It is possible that it isn't, in fact, possible to add this username to the Ubuntu print config. If so, where should I ask for an improvement?
-
Martin Owens -doctormo- almost 13 yearsYou can add the username to the URI when adding the printer right?
-
jonallard almost 13 yearsNo. (is too short)
-
Martin Owens -doctormo- almost 13 yearsThen this is a bug and should be reported under the gnome printer settings project in launchpad.
-
artfulrobot over 11 yearsyep, "wishlist" doesn't really help those of us stuck with an office full of Ubuntu PCs that now can't print. sigh
-
jonallard over 10 years"Ubuntu: We don't care."
-
MikeW over 7 yearsSince it affects all users on the same machine, just use your computer's hostname instead .... still recognisable !
-
bmaupin over 7 yearsThis didn't work for me for an IPP URI, although it did work for an LPD URI. I noticed the documentation (cups.org/doc/network.html) doesn't mention username as part of the IPP URI, but I'm not sure if that's significant or not.
-
bmaupin over 7 yearsUnfortunately some applications (e.g. LibreOffice) use their own print dialog that doesn't have this option...
-
bmaupin over 7 yearsThis works for me for LPD print queues but unfortunately not for IPP print queues (using Xubuntu 14.04, CUPS 1.7.2).
-
Supernormal about 6 yearsWhen I do that (using Kubuntu 16.04) cups just overwrites printers.conf with a version without the User directive, when I restart cups.
-
Igor Rodriguez almost 6 yearsDocumentation says that printers.conf is not intended to be edited or managed manually link
-
qwr over 5 years@Supernormal you must stop cups service first