First, we need sane backend, that is what works with your scanner on the apparatus level, include driver, firmware, etc and some utilities, which very help us in configuration and diagnostics. As root:
# apt-get install libsane sane-utils
Then go to get firmware. I have a Mustek BearPaw 1200CU Plus and as shown on SANE home page it uses gt68xx backend. Thus, I went to get firmware from http://www.meier-geinitz.de/sane/gt68xx-backend/, put in /usr/share/sane/gt68xx/, and make sure it is readable for everyone:
# chown root.scanner /usr/share/sane/gt68xx/PS1Dfw.usb
# chmod 755 /usr/share/sane/gt68xx/PS1Dfw.usb
The sane-utils package contain two tools we need. First we use sane-find-scanner to check if kernel support USB scanner:
found USB scanner (vendor=0x055f, product=0x021c [USB Scanner], chip=GT-6816) at libusb:003:002
It's seem OK. Let's check if scanimage works:
$ scanimage -L
No scanners were identified. If you were expecting something different,
check that the scanner is plugged in, turned on and detected by the
sane-find-scanner tool (if appropriate). Please read the documentation
which came with this software (README, FAQ, manpages).
But under root, scanimage gives a positive answer:
# scanimage -L
device `gt68xx:libusb:003:003' is a Mustek Bearpaw 1200 CU Plus flatbed scanner
Yes, you guess right. We have permission problem, programs works successfully under root and not as user. Although, Debian Lenny uses UDEV, all we need is to add appreciated users to scanner group, you know how :). Don't forget to logout and login again after that.
Mustek BearPaw 1200 CU Plus doesn't need any manual settings, so editing is no-needed, but take a look at /etc/sane.d/gt68xx.conf or your scanner backend's configuration file.
Now, when scanner is ready, scan your documents, images, etc by:
$ scanimage --device-name gt68xx:libusb:003:003 --resolution 300 --format png > test.png
Or, better, get a GUI frontend like Xsane:
# apt-get install xsane
Additional steps: Here, when configured the hotplug subsystem I needed to get sane-backends source from http://www.sane-project.org/, untar & copy hotplug files in subdir tools/hotplug into /etc/hotplug/usb then restart UDEV:
# /etc/init.d/udev restart
Note: If you have other scanner, just look for other sane backend.
1. SANE home page (especially documentations section).
3. Script and configuration files (/etc/hotplug/usb/*, /etc/sane.d/*)