Use different username on CUPS remote printing

32,104

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.

Share:
32,104

Related videos on Youtube

jonallard
Author by

jonallard

Updated on September 18, 2022

Comments

  • jonallard
    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 say jonallard.

    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-
    Martin Owens -doctormo- almost 13 years
    You can add the username to the URI when adding the printer right?
  • jonallard
    jonallard almost 13 years
    No. (is too short)
  • Martin Owens -doctormo-
    Martin Owens -doctormo- almost 13 years
    Then this is a bug and should be reported under the gnome printer settings project in launchpad.
  • artfulrobot
    artfulrobot over 11 years
    yep, "wishlist" doesn't really help those of us stuck with an office full of Ubuntu PCs that now can't print. sigh
  • jonallard
    jonallard over 10 years
    "Ubuntu: We don't care."
  • MikeW
    MikeW over 7 years
    Since it affects all users on the same machine, just use your computer's hostname instead .... still recognisable !
  • bmaupin
    bmaupin over 7 years
    This 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
    bmaupin over 7 years
    Unfortunately some applications (e.g. LibreOffice) use their own print dialog that doesn't have this option...
  • bmaupin
    bmaupin over 7 years
    This works for me for LPD print queues but unfortunately not for IPP print queues (using Xubuntu 14.04, CUPS 1.7.2).
  • Supernormal
    Supernormal about 6 years
    When 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
    Igor Rodriguez almost 6 years
    Documentation says that printers.conf is not intended to be edited or managed manually link
  • qwr
    qwr over 5 years
    @Supernormal you must stop cups service first