Online Book Reader

Home Category

Running Linux, 5th Edition - Matthias Kalle Dalheimer [280]

By Root 1114 0
or disabling browsing

While you're digging in the /etc/cups/cupsd.conf file, you may want to examine the server's browsing options. In the context of CUPS, browsing refers to automatic network printer discovery. This feature, supported by IPP, enables IPP servers to exchange lists of printers with one another. Each server periodically sends out broadcasts to which other IPP servers respond. The result is that you need configure each printer only once, on the computer to which it's connected. That server then propagates the configuration for the printer to other CUPS/IPP servers. Applications on those remote systems will see the new printer appear once they're restarted. This feature can be a great time-saver, particularly on networks on which printers are frequently added or removed.

A couple of caveats are in order concerning browsing, though. First, like many network features, browsing comes with some security baggage. Systems configured to browse could be tricked into displaying bogus printer information, and it's conceivable that a bug in the CUPS browsing code could lead to more serious system compromises. For this reason, some distributions ship with browsing disabled. This fact is the second caveat: if you do want to use browsing, you may need to enable it. If you fail to do so, your system won't automatically detect other printers on your network. Likewise, if you want to tell your system to enable others to print to its printers you must be sure certain options are enabled. You should check several options on your client and server systems:

BrowseAllow and BrowseDeny

These directives tell a CUPS client the addresses from which it should accept or reject browse packets, respectively. They take options with the same form as the Allow and Deny directives. On a LAN, setting BrowseAllow @LOCAL generally works well to enable a system to automatically detect remote printers. This option tells the system to accept browse packets from all the local interfaces. You can set specific IP addresses or hostnames instead of this option to tighten this security, or specify entire network addresses to loosen or change the security. You can also explicitly exclude computers or networks with BrowseDeny. You can include multiple BrowseAllow and BrowseDeny directives.

Browsing

This directive takes On and Off options. You should be sure that any CUPS server that is to share its printers has this directive set to On, which is the default setting for stock CUPS configurations. (Some distributions change the default to Off, though.)

BrowseAddress

You can tell a CUPS server to which addresses it should send browse packets with this directive, which takes IP addresses, network addresses, and hostnames in the same forms as the Allow and Deny directives. The default is to not send any browse packets, so chances are you'll need to set this line. Using BrowseAddress @LOCAL works well on small networks, but you may need to use multiple lines or configure your system in another way, depending on your network.

These browsing directives are typically set in the global section of the cupsd.conf file. They're sometimes set separately or redundantly in the /printers section, though, so check there if you have problems.

* * *

Tip


Actually printing to a server requires general access to the /printers section, independent of the browsing access. Thus, CUPS servers typically have one or more Allow directives in their /printers sections. Without these directives (either in this section or set globally), a CUPS server will reject incoming print jobs.

* * *

Restarting CUPS

If you make changes to your CUPS configuration, you should restart the CUPS daemon. On most distributions, this is done via the SysV startup script file:

# /etc/init.d/cupsd restart

This command (or one like it; you may need to change the path to cupsd) shuts down the CUPS daemon and restarts it. The result should be that the system implements any changes you make to the server's configuration.

Defining Printers in CUPS

Now that

Return Main Page Previous Page Next Page

®Online Book Reader