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 will be 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, you need to edit the file named /etc/ipd.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.

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 (by specifying an

IP address range). An entry in /etc/ipd.perms, for example, to allow print requests only from hosts on, would look like this:

accept sERVicE=X REM0TEIP=

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/ipd.perms (or /etc/ipd.conf).

If the computer with an attached printer is using Ubuntu and you want to set up the system for print serving, again use the gnome-cups-manager client to create a new printer.

To enable sharing, you must follow a few steps, because by default CUPS is not set up to share printers across a network.

First, edit your /etc/cups/cupsd.conf file using the following command:

$ sudo gedit /etc/cups/cupsd.conf

In this example I have used gedit, but feel free to substitute in your favorite text editor.

Then, look for the section that begins with <Location /> and modify it so that it reads as follows:

Order Deny,Aiiow

Deny From Aii

Aiiow From

Aiiow From 192.168.0.*


This tells CUPS to share your printers across the network 192.168.0.*, for example. Make sure and change this to match your own network settings.

Next you need to edit the /etc/cups/cups.d/ports.conf file to tell CUPS to listen on a specific port. Modify this line

Listen iocaihost:631

to this

Listen 631

to tell CUPS to listen on port 631 for any print requests. All you need to do now is open up gnome-cups-manager on your clients and select Detect LAN Printers under the Global Settings menu. After a few short moments, the printer should pop up in your window, as shown in Figure 22.7

Figure 22.7. The highlighted printer has been shared across the network. Ubuntu makes this process as painless as possible.

Figure 22.7. The highlighted printer has been shared across the network. Ubuntu makes this process as painless as possible.

Was this article helpful?

0 0

Post a comment