Accessing Non Linux Printers

Local networks today frequently contain multiple OSs. This fact can lead to complications, such as the need for one OS to understand the protocols intended for another OS. In the case of printing, the IPP and LPD protocols are native to Unix, and hence to Linux; you're most likely to use these protocols on a Linux print client when printing to a printer hosted on another Unix or Linux computer. Sometimes, though, you must print to a printer that's shared using another protocol. The two most common alternatives are the Server Message Block (SMB), aka the Common Internet File System (CIFS), which is used on Windows Networks; and AppleTalk, which is the native file- and printer-sharing protocol for Mac OS Classic. (The newer Mac OS X is Unix-based, but it still supports AppleTalk, and many network-enabled printers sold for the Macintosh market use AppleTalk directly.)

Note This section describes using SMB/CIFS- or AppleTalk-shared printers from

Linux. If you want to share a Linux printer with Windows clients, consult Chapter 24, "Sharing Files." You can share printers with Macintoshes using the Netatalk package introduced here, but its configuration for this role is beyond the scope of this book. As Mac OS X is Unix-based, you can easily configure it to use an LPD or IPP queue directly.

Printing to Windows Printers

Most Linux printer packages, including Apsfilter and CUPS, enable you to create a print queue that sends its output to an SMB/CIFS server. You typically do so in much the same way you'd create a queue for another LPD server, but the information you provide is different: In addition to a hostname and queue name, you must provide a username and password. Depending on how the server is configured, these might belong to an ordinary user's account or to a special printer account. Consult the Window's system's administrator for details.

Warning Linux print queues that print to an SMB/CIFS print queue generally store the username and password in an unencrypted form somewhere in the print queue directory or in a configuration directory. This practice is a potential security risk, especially if the account is an ordinary user account. If possible, configure the server to share the printer using a special printing-only account, so as to minimize the risk of storing the password on clients.

Printing to Wndows printers requires using the Samba ( package and, specifically, the smbprintorsmbspool script. This script is usually part of a package called samba-client, smbclient, or something similar. The smbprint script calls another program, smbclient, which submits the print job. Thus, in order to print to an SMB/CIFS printer, you must install the Samba client package for your distribution.

Printing to Macintosh Printers

The Netatalk package ( enables a Linux computer to function as a file and print server for Mac OS computers. Although it's primarily a server package, Netatalk also includes utilities that enable Linux to print to and control AppleTalk printers. These programs are pap, psf, and papstatus.

To print to an AppleTalk printer, you can use pap much as you'd use Ipr to print to a normal Linux print queue. For instance, to print to the AppleTalk printer called awriter, you'd type:

$ pap -p awriter

In many cases, you can use pap as a direct replacement for Ipr in just this way. You can print from the command line or replace a call to Ipr with a call to pap in GUI printing dialog boxes, such as the one forxv shown in Figure 13.3.

[¿3 Click To expand

Figure 13.3: You can print to AppleTalk printers using the pap command, bypassing the Linux print queue.

Some applications don't enable you to easily replace calls to Ipr, though. If you use such programs, you may want to create a conventional Linux print queue that redirects the print job via pap, much as you can create a queue that sends a print job using smbprint. The psf program is built for this task; it functions as an input filter for a BSD LPD or LPRng print queue. To use it in this way, you call it by an alternative name: ifpap. For instance, you might use this /etc/printcap entry:


This configuration requires a file called .paprc in the spool directory (/var/spool/lpd/awriter in this example). This file contains a single line with the name of the AppleTalk printer, such as awriter. Once this is configured, you can use Ipr to submit a print job to an AppleTalk printer.

CUPS uses a system of back-ends—programs that handle delivering print jobs to local and remote printers. These back-ends are stored in /usr/lib/cups/backend, and they can be binary programs or shell scripts. Unfortunately, CUPS comes with no standard AppleTalk back-end, and I know of none that work reliably. (Mandrake's version of CUPS ships with a pap back-end, but it doesn't work on my network. Other

CUPS pap back-ends I've found on the Internet also fail to work for me.) If printing using AppleTalk is vitally important to you, perhaps another printing system would be a better choice for you. Alternatively, you could delve into the CUPS documentation and write your own back-end.

Team LiB

This document was created by an unregistered ChmMagic, please go to http:/

0 0

Post a comment