Condivisione scanner in rete

[code]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).
[/code]

dato da root ?

si

scusa …

dal client :

# telnet 192.168.1.132 6566

cosa risponde ?

[code]# telnet 192.168.1.132 6566
Trying 192.168.1.132…
Connected to 192.168.1.132.
Escape character is ‘^]’.
Connection closed by foreign host.

[/code]

dal client:

# cat /etc/sane.d/dll.conf

[code] cat /etc/sane.d/dll.conf

enable the next line if you want to allow access through the network:

net
abaton
agfafocus
apple
avision
artec
artec_eplus48u
as6e
bh
canon
canon630u
canon_dr
#canon_pp
cardscan
coolscan
#coolscan2
coolscan3
#dc25
#dc210
#dc240
dell1600n_net
dmc
epjitsu
#epson
epson2
fujitsu
#gphoto2
genesys
gt68xx
hp
hp3900
hpsj5s
hp3500
hp4200
hp5400
hp5590
hpljm1005
hs2p
ibm
kodak
kvs1025
kvs20xx
leo
lexmark
ma1509
magicolor
matsushita
microtek
microtek2
mustek
#mustek_pp
mustek_usb
mustek_usb2
nec
niash
#p5
pie
pint
pixma
plustek
#plustek_pp
#pnm
qcam
ricoh
rts8891
s9036
sceptre
sharp
sm3600
sm3840
snapscan
sp15c
#st400
#stv680
tamarack
teco1
teco2
teco3
#test
u12
umax
#umax_pp
umax1220u
v4l
xerox_mfp
[/code]

rivediamo tutta la configurazione:

dal server:

[code]# cat /etc/xinetd.d/sane

cat /etc/sane.d/saned.conf

cat /etc/sane.d/net.conf

systemctl status xinetd.service

netstat -nap|grep 6566

scanimage -L

cat /etc/sane.d/dll.conf|grep net

[/code]

dal client :

[code]# rpm -qa|grep sane

cat /etc/sane.d/net.conf

scanimage -L[/code]

[code]# cat /etc/xinetd.d/sane

default: on

servizio per scanner in remoto

service sane-port
{
disable = no
port = 6566
socket_type = stream
protocol = tcp
wait = no
user = root
passenv = PATH
server = /usr/sbin/saned
}
[/code]

[code]# cat /etc/sane.d/saned.conf

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:7a8:185e::42:12]
#[2001:7a8:185e::42:12]/64

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)).

[/code]

[code]# cat /etc/sane.d/net.conf

This is the net backend config file.

net backend options

Timeout for the initial connection to saned. This will prevent the backend

from blocking for several minutes trying to connect to an unresponsive

saned host (network outage, host down, …). Value in seconds.

connect_timeout = 60

saned hosts

Each line names a host to attach to.

If you list “localhost” then your backends can be accessed either

directly or through the net backend. Going through the net backend

may be necessary to access devices that need special privileges.

localhost

192.168.1.0/24
127.0.0.1
[/code]

[code]# systemctl status xinetd.service
xinetd.service - Xinetd A Powerful Replacement For Inetd
Loaded: loaded (/usr/lib/systemd/system/xinetd.service; enabled)
Active: active (running) since Tue, 24 Jul 2012 08:18:55 +0200; 5h 21min ago
Process: 711 ExecStart=/usr/sbin/xinetd -stayalive -pidfile /var/run/xinetd.pid $EXTRAOPTIONS (code=exited, status=0/SUCCESS)
Main PID: 716 (xinetd)
CGroup: name=systemd:/system/xinetd.service
└ 716 /usr/sbin/xinetd -stayalive -pidfile /var/run/xine…

Jul 24 08:18:55 paolo-desktop xinetd[716]: removing time
Jul 24 08:18:55 paolo-desktop xinetd[716]: removing time
Jul 24 08:18:55 paolo-desktop xinetd[716]: xinetd Version 2.3.15 started wit…
Jul 24 08:18:55 paolo-desktop xinetd[716]: Started working: 1 available service
Jul 24 11:29:08 paolo-desktop xinetd[716]: START: sane-port pid=5161 from=::…1
Jul 24 11:29:08 paolo-desktop saned[5161]: saned (AF-indep+IPv6) from sane-b…p
Jul 24 11:29:08 paolo-desktop saned[5161]: check_host: access by remote host…1
Jul 24 11:29:08 paolo-desktop saned[5161]: init: access granted to paolo@127…1
Jul 24 11:29:11 paolo-desktop saned[5161]: io/hpmud/pp.c 627: unable to read…1
Jul 24 11:29:46 paolo-desktop xinetd[716]: EXIT: sane-port status=0 pid=5161…)
[/code]

]# netstat -nap|grep 6566 tcp6 0 0 :::6566 :::* LISTEN 716/xinetd

]# scanimage -L device `xerox_mfp:libusb:001:003' is a Samsung Samsung SCX-3200 Series multi-function peripheral device `net:127.0.0.1:xerox_mfp:libusb:001:003' is a Samsung Samsung SCX-3200 Series multi-function peripheral

[code]]# cat /etc/sane.d/dll.conf|grep net

enable the next line if you want to allow access through the network:

net
dell1600n_net
[/code]

Client:

# rpm -qa|grep sane sane-backends-1.0.22-8.fc16.i686 sane-backends-libs-1.0.22-8.fc16.i686 sane-backends-drivers-scanners-1.0.22-8.fc16.i686

[code]# cat /etc/sane.d/net.conf

This is the net backend config file.

net backend options

Timeout for the initial connection to saned. This will prevent the backend

from blocking for several minutes trying to connect to an unresponsive

saned host (network outage, host down, …). Value in seconds.

connect_timeout = 60

saned hosts

Each line names a host to attach to.

If you list “localhost” then your backends can be accessed either

directly or through the net backend. Going through the net backend

may be necessary to access devices that need special privileges.

localhost

192.168.1.132
[/code]

[code]# 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).
[/code]

dal server:

# leafpad /etc/sane.d/saned.conf

aggiungi in coda:

192.168.1.0/24 192.168.1.133 127.0.0.1
salva chiudi

poi:

# leafpad /etc/sane.d/net.conf

cancella le righe:

192.168.1.0/24 127.0.0.1
ed inserisci al loro posto:

localhost connect_timeout = 100
salva chiudi.

dai poi:

systemctl restart xinetd.service
# scanimage -L

posta l’output.

vai sul client da root:

# scanimage -L

posta l’output.

scanimage -L device `xerox_mfp:libusb:001:003' is a Samsung Samsung SCX-3200 Series multi-function peripheral device `net:localhost:xerox_mfp:libusb:001:003' is a Samsung Samsung SCX-3200 Series multi-function peripheral

dal client :

[code]]# 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).
[/code]