Printing On Linux (at Colby College)
- Published on
- Authors
Author: Sadir Islam
This blog is a quick guide on how to set up printing on Linux at Colby College. It might be helpful for students at other colleges as well.
Here are some prerequisites:
You should read the guide from Colby College IT Services: Printer Setup. You should understand how to add printers on Windows and MacOS.
You should make sure you are connected to the "Colby Access" network rather than "Colby Guest Access." The printers are only accessible from the "Colby Access" network.
You need to have CUPS installed. CUPS is a modular printing system for Unix-like operating systems. You likely already have it installed (and running) but if not, make sure to do so.
To check if you have it installed and running, run the following command:
systemctl status cups # if it's not running, you can start and enable it by running: sudo systemctl start cups sudo systemctl enable cups
Now, go to CUPS web interface by visiting http://localhost:631 in your browser.
Click on the "Administration" tab and then "Add Printer." Now you will be asked to enter details to add a printer.
- Select "Windows Printer via SAMBA" from "Other Network Printers"
- In the connection url enter
smb://printserver1.colby.edu/NAME_OF_PRINTER
e.g. if the printer name is "PHYS_M3HLL_1" then the connection url will besmb://printserver1.colby.edu/PHYS_M3HLL_1
- Enter the name of the printer, location, and description.
- Now you will need to select the appropriate driver for the printer. All of the printers I've added so far seem to be of the make Kyocera and the model "ECOSYS P3045dn." If you have the printer driver in your system, you can select it from the list. If not, you can download the driver from the Kyocera website. This is the recommended link but the downloaded content seems to be a program that installs the driver rather than the ppd file we want. So, instead, visit this link and download the Linux driver (8.1608) which contains the PPD file we need.
- After selecting the driver, click "Add Printer" and you should be good to go.
However, this printer requires your Colby username and password. This is kind of a hassle to do, and depending on what tools you have installed, it should hopefully ask you for it when you attempt to print something. You might be able to use some GUI like system-config-printer
to enter your credentials somewhere but I usually just edit the /etc/cups/printers.conf
file directly.
NOTE: There is a warning at the top of the file that states not to edit the file when CUPSD is running. So, you might want to stop the service before editing the file.
You want to go edit the /etc/cups/printers.conf
file and change the Device URI of your printer to
DeviceURI smb://email%40colby.edu:password@printserver1.colby.edu/
# for example if my email was hi@colby.edu with password 1234, the line would be
# DeviceURI smb://hi%40colby.edu:1234@printserver1.colby.edu
where email
is your Colby email username and password
is your Colby password. Both the email and password do need to be URI encoded (as you can see the @
was converted to %40
). Of course, this does mean you are storing your password in plain text on your system, which might not seem like the best idea. However, it seems as though this might not be a problem as the file is only readable as root (also read this stackexchange).
One-Liner
Or, instead, use this one-liner:
lpadmin -p printername -v smb://username:password@host/printer -m lsb/usr/filedriver.ppd -E