I recently decided to attach my scanner to my server so all machines could use the scanner without having to fiddle with cables etc. The scanner is a small Canon Lide 35 which is powered by the USB cable. The scanner also works perfectly with Linux.
First install sane-utils and xinetd.
1 |
apt-get install sane-utils xinetd |
Create the file /etc/xinetd.d/sane-port with the following contents.
1 2 3 4 5 6 7 8 9 10 11 12 13 |
# default: off # description: The sane server accepts requests # for network access to a local scanner via the # network. service sane-port { port = 6566 socket_type = stream wait = no user = saned group = scanner server = /usr/sbin/saned } |
Change RUN=no to RUN=yes in /etc/defaults/saned
1 2 3 4 5 6 7 |
# Defaults for the saned initscript, from sane-utils # Set to yes to start saned RUN=yes # Set to the user saned should run as RUN_AS_USER=saned |
Edit /etc/sane.d/saned.conf to allow your local subnet/single host etc to connect to the scanner.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# saned.conf # Configuration for the saned daemon ## Daemon options # Port range for the data connection. Choose a range inside [1024 - 65535]. # Avoid specifying too large a range, for performance reasons. # # ONLY use this if your saned server is sitting behind a firewall. If your # firewall is a Linux machine, we strongly recommend using the # Netfilter nf_conntrack_sane connection tracking module instead. # # data_portrange = 10000 - 10100 ## Access list # A list of host names, IP addresses or IP subnets (CIDR notation) that # are permitted to use local SANE devices. IPv6 addresses must be enclosed # in brackets, and should always be specified in their compressed form. # # The hostname matching is not case-sensitive. #scan-client.somedomain.firm #192.168.0.1 #192.168.0.1/29 #[2001:db8:185e::42:12] #[2001:db8:185e::42:12]/64 172.34.1.0/24 # NOTE: /etc/inetd.conf (or /etc/xinetd.conf) and # /etc/services must also be properly configured to start # the saned daemon as documented in saned(8), services(4) # and inetd.conf(4) (or xinetd.conf(5)). |
I added my local subnet at line 27.
Restart both xinetd and saned.
1 2 |
service xinetd restart service saned restart |
I also had to add the saned user to the scanner group ( Thanks to opennomad, See references below)
1 |
usermod -a -G scanner saned |
Now we need to edit the client (in this case Arch Linux with sane and sane-utils)
Edit this file nano /etc/sane.d/net.conf and the IP of the server to the bottom.
Then run scanimage -L and see if the scanner is detected. Should look something like this.
1 2 |
device `v4l:/dev/video0' is a Noname USB2.0 Camera virtual device device `net:172.34.1.7:genesys:libusb:001:003' is a Canon LiDE 35/40/50 flatbed scanner |
References:
easy steps to get remote scanning working in ubuntu (opennomad.com)