LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (http://www.linuxquestions.org/questions/linux-server-73/)
-   -   Why does lp return Unauthorized Error? (http://www.linuxquestions.org/questions/linux-server-73/why-does-lp-return-unauthorized-error-934210/)

cmnorton 03-13-2012 07:37 AM

Why does lp return Unauthorized Error?
 
I am running Ubuntu 10.04. My username is in adm and lpadmin.

All of a sudden, I can't print from the command line using lp.
lp: Unauthorized is returned.

What puzzles me is gedit can print.

What does this message mean, and how can I correct it?

Thanks.

jailbait 03-13-2012 12:26 PM

Find out where the lp command is with:

which lp

Then check the permissions on the lp command to make sure that you have execute permissions for lp.

--------------------
Steve Stites

cmnorton 03-13-2012 12:40 PM

Seem like correct permissions
 
-rwxr-xr-x 1 root root 13540 2011-09-12 10:41 /usr/bin/lp

jailbait 03-13-2012 03:12 PM

The next thing that I would check is your lpoptions. Maybe these users are blocked from using the printer. As root issue these commands:

lpoptions -U adm

lpoptions -U lpadmin

-------------------
Steve Stites

cmnorton 03-14-2012 06:13 AM

-U doesn't work
 
Thanks for following up on this.

cnorton@steamboy:~$ sudo -i
root@steamboy:~# lpoptions -U adm
Usage: lpoptions [-h server] [-E] -d printer
lpoptions [-h server] [-E] [-p printer] -l
lpoptions [-h server] [-E] -p printer -o option[=value] ...
lpoptions [-h server] [-E] -x printer

However, when I run lpotions for me and one of the printers, I get this.

lpoptions -d LaserJet4200-TurboPrint
auth-info-required=none copies=1 device-uri=socket://10.100.0.80:9100 finishings=3 job-hold-until=no-hold job-priority=50 job-sheets=none,none marker-change-time=1331657097 marker-colors=#000000,none marker-levels=48,97 marker-names='Black\ Cartridge\ HP\ CC364A,Maintenance\ Kit\ HP\ 110V-CB388A,\ 220V-CB389A' marker-types=tonerCartridge,fuser media=iso_a4_210x297mm number-up=1 printer-commands=AutoConfigure,Clean,PrintSelfTestPage printer-info=HP_LaserJet4200 printer-is-accepting-jobs=true printer-is-shared=false printer-location='IT Office' printer-make-and-model='HP_LaserJet4200 TurboPrint' printer-state=3 printer-state-change-time=1331657097 printer-state-reasons=none printer-type=10621012 printer-uri-supported=ipp://localhost:631/printers/LaserJet4200-TurboPrint sides=one-sided
cnorton@steamboy:~$

cmnorton 06-27-2012 11:30 AM

Here is the answer to this problem. I've copied the text from that link here.

I have tested this, and it works.


One thing that might be worth trying is:

sudo apt-get purge cups

That will not only uninstall cups but also delete its configuration files in case one of them is wrong.

Then:

sudo apt-get install cups

Since the configuration files are now fresh you will have to reinstall your printers. If you use any other computer as a print server you may have to do this there as well.

This opensuse link describes what another user had to do to one of his cups configuration files to solve this error message.




All times are GMT -5. The time now is 04:56 AM.