Linux Reality Episode 29: Printer Networking Extra Notes Install the CUPS server with your package manager. You do not necessarily have to use Samba to share printers. You only need Samba if you have a printer on your Windows machine that you want to print to from Linux. To start/stop/restart CUPS, do one of the following as root, depending on your distribution: /etc/init.d/cups start|stop|restart /etc/init.d/cupsd start|stop|restart /etc/init.d/cupsys start|stop|restart 1. Printers attached to a Linux machine that you want to connect to from Windows or other Linux machines. Edit /etc/cups/cupsd.conf - back it up first using cp!! Edit cupsd.conf as follows: Order allow,deny Allow 127.0.0.1 Allow 192.168.0.* <--this is your LAN subnet Then, enable Windows PCL drivers. PCL drivers send raw data to the print server. To enable raw printing on CUPS, you need to edit /etc/cups/mime.types and uncomment the line application/octet-stream. Then you need to edit /etc/cups/mime.convs and uncomment the line containing application/octet-stream: edit /etc/cups/mime.types (Uncomment the following line so that the file contains:) application/octet-stream edit /etc/cups/mime.convs (Uncomment the following line so that the file contains:) application/octet-stream application/vnd.cups-raw 0 Restart CUPS. Make sure your software firewalls either allow port 631 or turn them off temporarily. Open up a web browser and go to http://localhost:631 Click on "Administration" then "Add Printer." Name: (give it a short name that you will use on the network. No spaces. E.g. hp1300 Location: optional Description: optional Click continue. At "Device for _____" click drop down box and select where the printer is located, e.g. usb Then select manufacturer, model, and driver. Back at main screen, print test page and see if it works. Then, if it works, you'll want to connect from other machines. A. Connecting from another Linux machine. Install CUPS, go to http://localhost:631, add printer, then at "Device for _____" select "IPP". Then, at "Device URI", look at examples below the box. Usually, you will need to enter a syntax like: ipp://hostname/printers/printername or http://hostname:631/ipp/queue hostname = Linux machine where printer is printername = the short name you gave the printer, e.g. hp1300 B. Connecting from Windows machine Go to "Add Printer" wizard and select "network printer" and then enter in the URL with this syntax: http://hostname:631/printers/queue 2. Printers attached to a Windows machine that you want to access from Linux Make sure the printer is shared in Windows. On the Linux machine, install samba and CUPS. Edit /etc/samba/smb.conf as follows: [global] workgroup = YOUR_WINDOWS_WORKGROUP printers = cups printcap name = cups [printers] path = /var/spool/samba printable = yes guest ok = yes browseable = no public = yes Generally, must use Samba to share Windows printers. Windows does not serve printers with CUPS. Then, use the CUPS web-based GUI administration tool (localhost:631) to add the Windows-shared printer to your Linux machine. Click "Administration" then "Add Printer" and then when you get to the screen where you select where the printer is attached, there should be a "Windows printer via SAMBA" (or something like that) in the drop-down box. Select that, and then when you get to the screen where you enter the URI, use one of these two syntax: smb://username:password@WORKGROUP/server/printername smb://server/printername That is your Windows username and password. WORKGROUP is your Windows workgroup name, and server is the name of your Windows computer and printername is the name of the Windows printer. Updated: Tue Apr 10 20:06:36 EDT 2007