Easiest way to share a printer hooked up to a linux host

If you have a printer connected to a linux server (as you should) and have linux clients, here is the easiest way to share this printer without mucking too much with details, without mucking with samba.

Software: Fedora Linux 16

On the server:
1) First add its printer as usual, making sure it prints, and make sure “sharing” is selected.
2) Now use sudo system-config-firewall and open a special port, TCP 631 to outside traffic (just go to its second tab, click ADD and use user-specified port option)

On the client:
Adding the printer:
1) find the PPD of the printer, do a “locate ” such as “locate 4300”, where “somestring” is either the full model number of your printer, or something a bit more vague, for example, I found HP 4355’s ppd by trying 3 things: “locate 4355” then “locate 43xx” then “locate 4300” note its location.

2) copy from that location to your home directory with a
sudo cp /usr/share/ppd/HP/hp-laserjet_4300-ps.ppd.gz .
(that’s what I did).. Then gunzip this:
gunzip hp-laserjet_4300-ps.ppd.gz

3) now add the printer, changing the local name to something of your liking, IP address (put the IP of the server) and the name of that printer at server, as well as specifying that PPD file you just copied and gunzipped :
lpadmin -p IzmirHP -E -v http://192.168.2.34:631/printers/Officejet-4300-series -P hp-laserjet_4300-ps.ppd
(To find the printer’s name at the server, you can do a sudo cat /etc/cups/printers.conf at the server)
Now restart cups at client, service cups restart

That should do the trick..

This entry was posted in Linux. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *