Network Scanning

SANE was designed with flexibility in mind. In particular, the implementation of SANE as separate back-ends, SANE libraries, and front-ends makes it fairly easy to link together components in unusual ways. The existence of text-mode scanning tools such as scanimage is one example of this effect. Another example, and a more dramatic one, is the ability of SANE to handle scanning over a network. For instance, suppose you're configuring a small group of computers, such as public workstations in a university computing center or a pair of computers used by two people who share an office. You've got a scanner, and the small size of the room means that it's easy for everybody in the room to physically access the scanner. Using SANE, you can connect the scanner to one computer and yet make it available to every computer in the room as if the scanner were connected directly to each of the computers.

Warning Network scanning requires running a server on the computer to which the scanner connects. This activity imposes certain risks. You should exercise caution when implementing a network scanning configuration. Use a firewall, TCP Wrappers, orxinetd security options to limit who may access the scanner server. Chapter 20, "Controlling Network Access," describes network security in more detail.

Setting up network scanning requires different configurations on each of the computers. The trickiest part of this configuration is on the server side—the computer to which the scanner connects most directly. This system must run a SANE server, which is effectively middleware—that is, it sits between the back-end that talks to the scanner and the front-end on the client computer. This SANE server is called saned, and most Linux distributions place it in /usr/sbin. You configure it to run from a super server, such as inetd orxinetd, both of which are described in more detail in Chapter 22, "Running Servers." To do this, take the following steps:

1. Configure the scanner so that it works on the server system, as described earlier in "Configuring Scanner Software."

2. Check that saned is installed. It's usually part of the sane or sane-backends package. If it's not installed, locate and install the appropriate package.

3. If necessary, add an entry for the SANE port to /etc/services. Some distributions ship with this entry present, but others don't. Look for it, and if it's not present, add it:

sane 6566/tcp # SANE network scanner access

4. Create a super server configuration for saned. Consult Chapter 22 for more information on super server configuration.

A. Debian, Slackware, and SuSE all use inetd by default. An /etc/inetd.conf line for saned looks like this, although you should use a username and group that's present on your system:

sane stream tcp nowait saned.saned /usr/sbin/saned saned

B. Mandrake and Red Hat both use xinetd as a super server. For these distributions, you should create an /etc/xinetd.d/saned file that contains the following lines:

service sane {

disable = no socket_type = stream protocol = tcp wait = no user = saned group = saned server = /usr/sbin/saned

5. Pass a SIGHUP signal to the super server. Type ps ax | grep inetd to find the process ID (PID) number, and then type kill -SIGHUP pid, where pid is the PID number, to do the job. This process is described in more detail in Chapter 22.

6. Be sure that the user or group you've configured the super server to use when launching saned exists and has access to the scanner's file. It's best if this user has no other privileges on the computer and cannot log in at all.

7. Add the hostnames of all the computers that should have access to the scanner to the /etc/sane.d/saned.conf file, one per line. This file is the primary access control method used by saned.

At this point, the saned server should respond to queries, but you need to tell clients how to access the server. To do this, you need to perform the following configuration steps:

1. Include the net option in the/etc/sane.d/dll.conf files on the clients. This option tells the SANE libraries on the clients to look for network scanners.

2. Edit the /etc/sane.d/net.conf files on the clients, and include the hostname of the SANE server system.

At this point, the scanner should work from the clients. The sane-find-scanner program won't work, but scanimage -L should turn up the network scanner:

$ scanimage -L

device ,net:scan.luna.edu:umax1220u:/dev/usb/scanner0' is a UMAX Astra 1220U ^flatbed scanner

Note that the scanner device name has two additional elements: The keyword net leads the identifier, and that keyword is followed by the hostname of the server system. You can pass this entire scanner device name to front-ends that require it, or you can rely on the auto-detection mechanisms of programs such as XSane.

Tip You can access a SANE-served network scanner from OSs other than Linux. You can find pointers to SANE front-ends for various OSs at http://www.mostang.com/sane/sane-frontends.html. Of particular interest, front-ends for Windows are available, and they can work with many Windows scanning applications.

Team LIB

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

0 0

Post a comment