Tuesday, May 02, 2006

Ubuntu Printer Sharing: a Repost

This is a re-issue of my blog post on my previous pseudo tech blog... and its my personal favorite coz it has been a "bestseller". I hope it helps!

I want to share my HP printer (old) to other computers (Ubuntu and Window$ boxes) in a LAN.

There must be some other ways to do it but this is how it worked for me (learned it with Mr. Google):

Backup your /etc/cups/cupsd.conf:

>> sudo cp /etc/cups/cupsd.conf /etc/cups/cupsd.conf.backup

Edit /etc/cups/cupsd.conf:

>> sudo gedit /etc/cups/cupsd.conf

Delete everything in the file and replace it with the values below (replace 192.168.0* appropriately with your LAN configuration):

DefaultCharset notused
LogLevel info
Printcap /var/run/cups/printcap
User cupsys
Group lpadmin
RunAsUser Yes
Port 631
Include cupsd-browsing.conf

BrowseAddress @LOCAL
SystemGroup lpadmin

<Location />
Order Deny,Allow
Deny From All
Allow From 127.0.0.1
Allow From 192.168.0.*
</Location>

<Location /jobs>

AuthType Basic
AuthClass User
</Location>

<Location /admin>
AuthType Basic
AuthClass System
Order Deny,Allow
Deny From All
Allow From 127.0.0.1

</Location>

To enable, do a:

>> sudo /etc/init.d/cupsys restart

On the Ubuntu or Linux boxes where you want to share your printer, open to edit /etc/cups/client.conf:

>> sudo gedit /etc/cups/client.conf

And add the following:

ServerName hostname (hostname or IP of the printer server)

Once this is all setup, you should be able to go to: System -> Administration -> Printing and in the top tool bar you'll see: Global Settings You'll want to make sure the following is checked:

Detect Lan Printers

On the Windows boxes, just add the printer server as you normally do.

To make your printer browsesable in a LAN network, edit your /etc/cups/cupsd-browsing.conf:

>> sudo gedit /etc/cups/cupsd-browsing.conf

Simply replace the word "Off" with "On" (without the ""), don't worry...that file has only one line so you won't ever have difficulties finding it. I guess you have to do a "sudo /etc/init.d/cupsys restart" after this. :)

So that's it! Everybody happy printing their stuff on your HP or any other installed printer on your PC!

UPDATE: To share your printer with Windows PCs, in the add printer wizard there is a step there when you'll have to enter the following lines:

>> http://ip_address_of_server:631/printers/share_name_of_printer

Voila! That's it mama!

2 comments:

Anonymous said...

Hi,

The instructions are great, thank you! One little note: I installed a new version of Ubuntu and the browsable on/off is now located at /etc/cups/cups.d/browse.conf

I hope this helps,

Best!

Anonymous said...

This is what I yesterday in Dapper... I installed a printer, and whoala! Its automatically browseable by Windows PCs in a LAN.

Neat.