Previous Section  < Day Day Up >  Next Section

Recipe 23.23. Sharing Windows Printers with Linux

23.23.1 Problem

You run a mixed Windows/Linux LAN, and you want your Linux users to be able to print to the Windows-connected printers.

23.23.2 Solution

You need both CUPS and Samba to do this. Here's what you need to do:

  1. Install printers on your Windows boxes, and share them in the normal manner.

  2. On Windows NT/2000/XP, make sure that the "guest" account is enabled, and make sure that "Everyone" has permission to print to the shared printers.

  3. Install CUPS on the Samba server (see Chapter 14).

  4. Configure CUPS for Samba.

  5. Create a printers share in smb.conf on the Samba server.

To configure CUPS for Samba, run the following command:

# ln -s `which smbspool` /usr/lib/cups/backend/smb

These lines in smb.conf share all printers on the network:

[printers]

   comment = All Printers

   printing = cups

   printcap name = cups

Restart Samba after editing smb.conf.

Next, install the Windows printers on the Samba server with CUPS. Open the CUPS web interface (http://localhost:631/admin). Log in as root.

Click "Add Printer" and enter the printer name, which in this example is "Alps." Enter the location and description, then go to the next window, which is the Device window. Click on the drop-down menu, scroll to the bottom, and select "Windows Printer Via Samba."

In the next window, "Device URI for Alps," enter the device URI. "Alps" is connected to powerpc on Windows 2000, so you must enter the "guest" username and hostname:

smb://guest@powerpc/alps

In the next two windows, select the printer driver.

Print a test page from the server. Then move to a Linux client and open the CUPS web interface. If you configured CUPS correctly, the printer will appear. Print a test page from the Linux client. Now any Linux client on the LAN can use this printer.

23.23.3 Discussion

Printers connected to Windows 95/98/ME do not need a username, nor do they have guest accounts. All you need to do is share the printer. Recipe Recipe 23.4 goes into more detail on enabling sharing in the various Windows versions.

Note that you can use a standalone CUPS printer server, without Samba, for both Windows and Linux clients (see Chapter 14). However, you need Samba to make Windows printers available to Linux.

23.23.4 See Also

    Previous Section  < Day Day Up >  Next Section