### How to share a scanner via the network using SANE? ###
       
       
       Today I decided to set up a network access for all my LAN to my Agfa e20 scanner. This way every user of my LAN would be able to scan documents from withing its own workstation.
       My scan server is an OpenSUSE 11.1 PC. Clients are running OpenSUSE 11.3 (but the configuration of SANE stuff should be the same on most Linux systems anyway).
       
       I assume that the scanner is already working locally (that is, it is possible to scan document on the PC that is directly attached to the scan device). Here I am describing how I've shared the scanner to all clients in my network.
       
       On the server:
       
       /etc/sane.d/saned.conf
       This file is contains the list of hosts that are allowed to use locally attached scanner devices. I simply added there this line:
       192.168.0.0/24
       
       Therefore I am authorizing all my LAN (192.168.0.0/24) to have access to the scanner via network.
       
       
       /etc/xinetd.d/sane-port
       
       The saned daemon (which is responsible for the sharing of the scanner over the network) is not a stand-alone daemon, it requires an inet superserver to listen on a TCP socket. The superserver I am using is xinetd, so I created a file named /etc/xinetd.d/sane-port with the following content:
       service sane-port
       {
           socket_type = stream
           port        = 6566
           wait        = no
           user        = root
           group       = root
           server      = /usr/sbin/saned
           disable     = no
       }
       Of course, you need to declare sane-port as a service in /etc/services (if it is not already done). Here is the related line from my /etc/services file:
       sane-port       6566/tcp   # SANE Control Port
       
       Note, that you will need to allow access to the port 6566 on your server if you are using any kind of firewall.
       
       
       On the client:
       
       On the client side, the configuration is rather straigh-forward. First, I enabled the "net" plugin for sane, to make it aware of network-attached scanners. To do that, simply make sure that your /etc/sane.d/dll.conf file contains such line:
       net
       
       Then, I edited the file /etc/sane.d/net.conf (which contains the list of scan server that the net plugin of sane can access), and added this line:
       192.168.0.20
       
       The 192.168.0.20 IP address is nothing else than the IP of my scan server.
       At this time, I launched the xsane tool on the client PC, and I was able to perform a scan action on the remote scanner device. Hooray!