Книга: Fedora™ Unleashed, 2008 edition

Enabling Network Printing on a LAN

Enabling Network Printing on a LAN

To set up printing from one Linux workstation to another across a LAN, you need root permission and access to both computers, but the process is simple and easy to perform.

First, log in or ssh to the computer to which the printer is attached. This computer is the printer server. Use the hostname or ifconfig commands to obtain the hostname or IP address and write down or note the name of the printer queue. If the system uses LPRng rather than CUPS (Common UNIX Printing System), you need to edit the file named /etc/lpd.perms. Scroll to the end of the file and look for the remote permission entry:

# allow local job submissions only
REJECT SERVICE=X NOT SERVER

Remote printing is not enabled by default, so you must comment out the service reject line with a pound sign (#):

# allow local job submissions only
#REJECT SERVICE=X NOT SERVER

Save the file, and then restart the lpd daemon.

This enables incoming print requests with the proper queue name (name of the local printer) from any remote host to be routed to the printer. After you finish, log out and go to a remote computer on your LAN without an attached printer.

TIP

LPRng, like CUPS, can be configured to restrict print services to single hosts, one or more specific local or remote users, all or part of a domain, or a LAN segment (if you specify an IP address range). An entry in /etc/lpd.perms, for example, to allow print requests only from hosts on 192.168.2.0, would look like this:

ACCEPT SERVICE=X REMOTEIP=192.168.2.0/255.255.255.0

The lpd.perms man page (included as part of the LPRng documentation) contains an index of keywords you can use to craft custom permissions. Don't forget to restart the lpd daemon after making any changes to /etc/lpd.perms (or /etc/lpd.conf).

If the computer with an attached printer is using Fedora and you want to set up the system for print serving, again use the system-config-printer client. You can create a new printer, but the easiest approach is to publish details of your printer across the network.

To enable sharing, start system-config-printer, and then select the Server Settings option in the left pane. All you need to do is select Share Published Printers Connected to This System to automatically allow access to all your printers, as shown in Figure 19.9.


FIGURE 19.9 Sharing enables you to offer a locally attached printer as a remote printer on your network.

By default, all users are allowed access to the printer. You can change this setting by selecting the Access Control tab and adding users into the list.

Finally, you need to allow Fedora to publish your selected shared printers across the network. Click the Server Settings and make sure the Share Published Printers Connected to This System option is checked.

TIP

If you will share your CUPS-managed printer with other Linux hosts on a LAN using the Berkeley-type print spooling daemon, lpd, check the Enable LPD Protocol item under the Sharing dialog box's General tab. Next, check that the file cups-lpd under the /etc/xinetd.d directory contains the setting disable = no and then restart xinetd. This enables CUPS to run the cups-lpd server and accept remote print jobs sent by lpd from remote hosts. Do not forget to save your changes and restart CUPS!

When finished, click the Apply button and then select Quit from the Action menu to exit.

To create a printer queue to access a remote UNIX print server, use system-config-printer to create a printer but select the Internet Printing Protocol (IPP) type. Click Forward and enter a printer name and description; you are then asked to enter the hostname (or IP address) of the remote computer with a printer, along with the printer name, as shown in Figure 19.10.


FIGURE 19.10 Enter the hostname or IP address of the remote computer with a printer, along with the remote printer's queue name.

NOTE

Browse to http://www.faqs.org/rfcs/rfc1179.html to read more about using the Strict RFC 1179 Compliance option when configuring Fedora to be able to print to a remote UNIX printer. This 13-year-old Request For Comments (RFC) document describes printing protocols for the BSD line-printer spooling system. The option is used to allow your documents to print to remote servers using the older print system or software conforming to the standard.

Click the Forward button after entering this information; then continue to configure the new entry as if the remote printer were attached locally (use the same print driver setting as the remote printer). When finished, do not forget to save the changes!

You can also test the new remote printer by clicking the Tests menu item and using one of the test page items, such as the ASCII or PostScript test pages. The ASCII test page prints a short amount of text to test the spacing and page width; the PostScript test page prints a page of text with some information about your printer, a set of radial lines one degree apart, and a color wheel (if you use a color printer).

Оглавление книги


Генерация: 1.371. Запросов К БД/Cache: 3 / 1
поделиться
Вверх Вниз