Skip to content

Instantly share code, notes, and snippets.

@nkile
Last active August 29, 2015 14:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nkile/fb4c090a7d8f30905942 to your computer and use it in GitHub Desktop.
Save nkile/fb4c090a7d8f30905942 to your computer and use it in GitHub Desktop.
Red Hat Printing via PaperCut

First make sure the CUPS daemon in running:

/etc/init.d/cups status

If it isn't, start it, then set it to run at system boot:

sudo /etc/init.d/cups start
sudo chkconfig cups on

PaperCut authentication via AD is easiest achieved by placing the username and password into the smb URI. In the example of setting up the Doan 104 HP Laserjet 4700:

sudo lpadmin -p DC104HPColor -E -v smb://ColleaguePrinting:password@ad/print.ad.midmich.edu/DC104HPColor

-p DC104HPColor sets the printer name for the system and can be anything. ColleaguePrinting is the AD username, followed by the AD password. Everything after the @ is the location of the AD print queue, following the //server/printer format. Since no driver is specified in this command, it will apply a generic driver.

Set the printer to default:

sudo lpadmin -d DC104HPColor

Check to make sure the printer is both entered in and enabled:

lpstat -p
printer DC104HPColor is idle.  enabled since Thu 11 Dec 2014 01:51:21 PM EST

Set CUPS to raw printing mode (for Colleague purposes):

sudo lpadmin -p DC104HPColor -o raw=true

Check /etc/cups/lpoptions to see if the option was applied:

sudo nano  /etc/cups/lpoptions
  GNU nano 2.0.9           File: etc/cups/lpoptions

Default DC104HPColor raw=true

Finally, test the printer settings by using lpr to send a test postscript to the printer:

lpr usr/share/cups/data/testprint

The printer configuration can be checked by viewing printers.conf:

sudo nano etc/cups/printers.conf
  GNU nano 2.0.9          File: etc/cups/printers.conf

# Printer configuration file for CUPS v1.4.2
# Written by cupsd on 2014-12-11 10:53
# DO NOT EDIT THIS FILE WHEN CUPSD IS RUNNING
<Printer DC104HPColor>
Info DC104HPColor
DeviceURI smb://ColleaguePrinting:password@ad/print.ad.midmich.edu/DC104HPColor
State Idle
StateTime 1418313188
Type 4
Accepting Yes
Shared Yes
JobSheets none none
QuotaPeriod 0
PageLimit 0
KLimit 0
OpPolicy default
ErrorPolicy stop-printer
</Printer>

Note the third comment line. Editing is only allowed if the cups daemon is shutdown.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment