You are not logged in.

#1 2008-10-14 13:53:07

samsari
Member
Registered: 2008-08-02
Posts: 3

Printing a document as a different user

Hi there. I have a question regarding a particular CUPS setup that I have to use.

Basically, I am a student at university and our printer network uses a printer credit system to make sure we don't take advantage and print lots of documents needlessly. It uses a CUPS server to run all this, and is set up to only allow print jobs which originate from approved usernames (the university ID we are all given). This means that the only print instructions we are given is "create a new user on your laptop with the same name as your id, and print from that account".

Now, as you can imagine, that is hardly an acceptable solution; I don't really want to go through the hassle of moving all my stuff to a new user account, I am quite attached to my current username thankyouverymuch. I have CUPS set up on my laptop to choose the correct printer easily enough. And I have managed to get documents to print from within my original user account (let's say 'foo') by creating a new user on my laptop with the correct name (again, let's say 'bar') and printing manually from the command line:

[foo@jiraiya ~]$ lp -U bar file_to_print.ps

However, if I try to print from, say, OpenOffice it sends the command straight to CUPS as the original user (foo). I'm assuming this is because OO.o and Gnome have their own internal ways of talking to CUPS. My problem is that if I try and print from anything other than the commandline, it sends the file as foo and not bar.

Is there a way to set up CUPS itself to convert any print job to a particular user before sending it onto the remote print server? I know it's easy to make any process you like run as any user you like in linux, so it has to be possible at some stage of the process to have cups send the request as a different user than the originator. I have searched through all the CUPS config files, and all the forums I can find and have found nothing relating to my problem. Please tell me that I am not the first person to run into this issue?

/richard

Last edited by samsari (2008-10-16 13:59:55)

Offline

#2 2009-04-27 10:33:57

mélodie
Member
From: France
Registered: 2006-12-31
Posts: 16
Website

Re: Printing a document as a different user

Hi,

Instead of creating a new user and account with that name/id, try creating a group that bears this name and id, and become member of this group.

Last edited by mélodie (2009-04-27 10:35:04)

Offline

#3 2009-04-27 11:10:03

fumbles
Member
Registered: 2006-12-22
Posts: 245

Re: Printing a document as a different user

$ su bar -c ' lp file_to_print.ps'

I don't suppose that could work?

OR:
$ lp -U bar -u bar file_to_print.ps

Last edited by fumbles (2009-04-27 11:11:09)

Offline

#4 2014-01-06 20:23:43

yourealwaysbe
Member
Registered: 2010-05-29
Posts: 22

Re: Printing a document as a different user

I found that putting

    export CUPS_USER=<username>

into .xinitrc, or .bashrc, or wherever works for me.

Offline

#5 2014-01-06 21:10:37

jasonwryan
Forum & Wiki Admin
From: .nz
Registered: 2009-05-09
Posts: 12,872
Website

Re: Printing a document as a different user


Arch + dwm   •   Mercurial repos

Registered Linux User #482438

Offline

Board footer

Powered by FluxBB