------------------------------------------------------------------------ http://www.linux.com/feature/57798 http://www.linux.com/feature/59138 http://www.linuxplanet.com/linuxplanet/tutorials/6412/3/ http://penguin-breeder.org/sane/saned/ apt-get install sane-utils libsane-extras whereis saned saned: /usr/sbin/saned man saned cp --verbose /etc/sane.d/saned.conf /etc/sane.d/saned.conf.backup echo "192.168.1.0/24" | tee /etc/sane.d/saned.conf cat /etc/sane.d/saned.conf 192.168.1.0/24 # echo "sane-port 6566/tcp # SANE network scanner daemon" | tee -a /etc/services grep sane /etc/services sane-port 6566/tcp sane saned # SANE network scanner daemon dpkg -S inetd dpkg -S xinetd groups saned saned grep saned /etc/passwd saned:x:117:126::/home/saned:/bin/false grep saned /etc/group scanner:x:104:hplip,saned saned:x:126: apt-cache search xinetd apt-get install xinetd echo '# 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 = saned server = /usr/sbin/saned }' /etc/xinetd.d/saned cat /etc/xinetd.d/saned # default: off # description: The sane server accepts requests # for network access to a local scanner via the # network. service sane-port { socket_type = stream server = /usr/sbin/saned protocol = tcp user = saned group = saned wait = no disable = no } chown root:root /etc/xinetd.d/saned chmod 644 /etc/xinetd.d/saned ls -hal /etc/xinetd.d/saned -rw-r--r-- 1 root root 283 2008-09-24 10:23 /etc/xinetd.d/saned # echo "sane-port stream tcp nowait saned.saned /usr/sbin/saned saned" | tee -a /etc/inetd.conf # cat /etc/inetd.conf /etc/init.d/xinetd restart echo net | tee /etc/sane.d/dll.conf echo hpaio | tee -a /etc/sane.d/dll.conf cat /etc/sane.d/dll.conf net hpaio hp-check -r HP Device 0x5b11 at 001:003: Device URI: hp:/usb/Officejet_J5700_series?serial=CN7BOCF3HP04TC Device node: /dev/bus/usb/001/003 Mode: 0660 ls -hal /dev/bus/usb/001/003 crw-rw---- 1 lp scanner 189, 2 2008-09-24 10:33 /dev/bus/usb/001/003 adduser saned scanner sudo -u saned scanimage -L device `hpaio:/usb/Officejet_J5700_series?serial=CN7BOCF3HP04TC' is a Hewlett-Packard Officejet_J5700_series all-in-one telnet localhost 6566 Trying 127.0.0.1... Connected to localhost. Escape character is '^]'. ps aux | grep saned root 16154 0.0 0.0 5164 828 pts/0 R+ 14:33 0:00 grep saned # on client: echo "192.168.1.1" | sudo tee -a /etc/sane.d/net.conf telnet 192.168.1.1 6566 Trying 192.168.1.1... Connected to 192.168.1.1. Escape character is '^]'. 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). # on server: tail --line=100 --follow /var/log/syslog saned[17186]: saned (AF-indep+IPv6) from sane-backends 1.0.19 ready saned[17186]: check_host: access by remote host: 192.168.1.239 saned[17186]: init: access granted to jelle@192.168.1.239 kernel: [885131.648358] IN= OUT=eth1 SRC=84.245.3.195 DST=255.255.255.255 LEN=65 TOS=0x00 PREC=0x00 TTL=64 ID=0 DF PROTO=UDP SPT=38311 DPT=1124 LEN=45 saned[17186]: quit: exiting ------------------------------------------------------------------------ cat /etc/apt/sources.list echo "deb http://ftp.nl.debian.org/debian/ lenny main" | tee -a /etc/apt/sources.list.lenny echo "deb-src http://ftp.nl.debian.org/debian/ lenny main" | tee -a /etc/apt/sources.list.lenny echo "deb http://security.debian.org/ lenny/updates main" | tee -a /etc/apt/sources.list.lenny echo "deb-src http://security.debian.org/ lenny/updates main" | tee -a /etc/apt/sources.list.lenny cp --verbose /etc/apt/sources.list /etc/apt/sources.list.hardy cp --verbose /etc/apt/sources.list.lenny /etc/apt/sources.list apt-get update gpg --keyserver wwwkeys.eu.pgp.net --recv-keys A70DAF536070D3A1 gpg --keyserver wwwkeys.eu.pgp.net --recv-keys B5D0C804ADB11277 gpg --armor --export A70DAF536070D3A1 | apt-key add - gpg --armor --export B5D0C804ADB11277 | apt-key add - grep CONFIG_NF_CONNTRACK_SANE /boot/config-2.6.22-3-amd64 CONFIG_NF_CONNTRACK_SANE=m cp --verbose /etc/apt/sources.list.hardy /etc/apt/sources.list apt-get update ------------------------------------------------------------------------ uname -r 2.6.22-3-amd64 grep CONFIG_NF_CONNTRACK_SANE /boot/config-2.6.22-3-amd64 CONFIG_NF_CONNTRACK_SANE=m grep sane /proc/modules nf_conntrack_sane 11504 0 - Live 0xffffffff88273000 nf_conntrack 75356 8 nf_conntrack_sane,ipt_MASQUERADE,xt_state,nf_nat_sip,nf_conntrack_sip,iptable_nat,nf_nat,nf_conntrack_ipv4, Live 0xffffffff88184000 Sep 23 23:50:19 ashley saned[4858]: saned (AF-indep+IPv6) from sane-backends 1.0.19 ready Sep 23 23:50:19 ashley saned[4858]: check_host: access by remote host: 192.168.1.239 Sep 23 23:50:19 ashley saned[4858]: init: access granted to jelle@192.168.1.239 Sep 23 23:50:20 ashley kernel: IN= OUT=eth1 SRC=84.245.3.195 DST=255.255.255.255 LEN=65 TOS=0x00 PREC=0x00 TTL=64 ID=0 DF PROTO=UDP SPT=32769 DPT=1124 LEN=45 Sep 23 23:50:20 ashley saned[4858]: quit: exiting ------------------------------------------------------------------------ # Remove any existing rules from all chains /sbin/iptables --flush /sbin/iptables --flush --table nat /sbin/iptables --flush --table mangle # Remove any pre-existing user-defined chains /sbin/iptables --delete-chain /sbin/iptables --delete-chain --table nat /sbin/iptables --delete-chain --table mangle # Zero counts /sbin/iptables --zero # allow all incomming and forwarded trafic, and allow outgoing trafic /sbin/iptables --policy INPUT ACCEPT /sbin/iptables --policy FORWARD ACCEPT /sbin/iptables --policy OUTPUT ACCEPT # Export enviorment settings # LAN is the device connect to the private internal network # WAN is the device connect to the outside internet network export LAN=eth0 export WAN=eth1 # Activate forwarding in kernel /bin/echo "1" > /proc/sys/net/ipv4/ip_forward # Use masquerade so the outside world sees only one ip source for all outgoing trafic: /sbin/iptables --table nat --append POSTROUTING --out-interface ${WAN} --jump MASQUERADE /sbin/iptables -L -n --line-numbers Chain INPUT (policy ACCEPT) num target prot opt source destination Chain FORWARD (policy ACCEPT) num target prot opt source destination Chain OUTPUT (policy ACCEPT) num target prot opt source destination ------------------------------------------------------------------------ # on sever: /etc/init.d/xinetd stop SANE_DEBUG_HP=128 saned -d128 [saned] main: starting debug mode (level 128) [saned] main: trying to get port for service `sane-port' (getaddrinfo) [saned] main: [0] socket () using IPv4 [saned] main: [0] setsockopt () [saned] main: [0] bind () to port 6566 [saned] main: [0] listen () [saned] main: [1] socket () using IPv6 [saned] main: [1] socket failed: Address family not supported by protocol [saned] main: waiting for control connection [saned] saned (AF-indep+IPv6) from sane-backends 1.0.19 ready [saned] check_host: access by remote host: 192.168.1.239 [saned] check_host: remote host is not IN_LOOPBACK nor IN6_LOOPBACK [saned] check_host: local hostname: ashley [saned] check_host: local hostname(s) (from DNS): ashley.powercraft.nl [saned] check_host: local hostname(s) (from DNS): (null) [saned] check_host: local hostname(s) (from DNS): (null) [saned] check_host: remote host doesn't have same addr as local [saned] check_host: opening config file: /etc/hosts.equiv [saned] check_host: can't open config file: /etc/hosts.equiv (No such file or directory) [saned] check_host: opening config file: saned.conf [saned] check_host: config file line: `192.168.1.0/24' [saned] check_host: subnet with base IP = 192.168.1.0, CIDR netmask = 24 [saned] check_host: access granted from IP address 192.168.1.239 (in subnet 192.168.1.0/24) [saned] init: access granted [saned] init: access granted to jelle@192.168.1.239 [saned] process_request: waiting for request [saned] process_request: got request 1 [sanei_debug] Setting debug level of hp to 128. [hp] sane_init called [hp] hp_init: global.is_up = 1 [hp] sane_init will finish with Success [hp] sane_get_devices called [hp] hp_read_config: hp backend v1.06/$Revision: 1.21 $ starts reading config file [hp] hp_read_config: processing line [hp] hp_read_config: processing line <# Uncomment the following if you have "Error during device I/O" on SCSI> [hp] hp_read_config: processing line <# option dumb-read> [hp] hp_read_config: processing line <#> [hp] hp_read_config: processing line <# The usual place for a SCSI-scanner on Linux> [hp] hp_read_config: processing line [hp] hp_attach_matching_devices: attach matching scsi HP [hp] hp_read_config: processing line <#> [hp] hp_read_config: processing line <# USB-scanners supported by the hp-backend> [hp] hp_read_config: processing line <# HP ScanJet 4100C> [hp] hp_read_config: processing line [hp] hp_attach_matching_devices: attach matching /dev/scanner [hp] hp_attach: "/dev/scanner" [hp] hp_get_dev: New device /dev/scanner, connect-scsi, scsi-request=1 [hp] sanei_hp_device_new: /dev/scanner [hp] hp_GetOpenDevice: device /dev/scanner not open [hp] scsi_new: open failed (Invalid argument) [hp] /dev/scanner: Can't open scsi device [hp] hp_read_config: processing line <# HP ScanJet 5200C> [hp] hp_read_config: processing line [hp] hp_attach_matching_devices: usb attach matching "usb 0x03f0 0x0101" [hp] hp_read_config: processing line <# HP ScanJet 62X0C> [hp] hp_read_config: processing line [hp] hp_attach_matching_devices: usb attach matching "usb 0x03f0 0x0401" [hp] hp_read_config: processing line <# HP ScanJet 63X0C> [hp] hp_read_config: processing line [hp] hp_attach_matching_devices: usb attach matching "usb 0x03f0 0x0201" [hp] hp_read_config: processing line <#> [hp] hp_read_config: processing line <# Uncomment the following if your scanner is connected by USB,> [hp] hp_read_config: processing line <# but you are not using libusb> [hp] hp_read_config: processing line <# /dev/usb/scanner0> [hp] hp_read_config: processing line <# option connect-device> [hp] hp_read_config: attach usb 0x03f0 0x0601 [hp] hp_attach_matching_devices: usb attach matching "usb 0x03f0 0x0601" [hp] hp_read_config: reset to default config [hp] sane_get_devices will finish with Success [saned] process_request: waiting for request [saned] process_request: got request 10 [hp] sane_exit called [hp] hp_destroy: global.is_up = 0 [hp] sane_exit will finish [saned] quit: exiting # on client: scanimage -L device `net:192.168.1.1:hpaio:/usb/Officejet_J5700_series?serial=CN7BOCF3HP04TC' is a Hewlett-Packard Officejet_J5700_series all-in-one # on server: sudo -u saned SANE_DEBUG_HP=128 saned -d128 [saned] main: starting debug mode (level 128) [saned] main: trying to get port for service `sane-port' (getaddrinfo) [saned] main: [0] socket () using IPv4 [saned] main: [0] setsockopt () [saned] main: [0] bind () to port 6566 [saned] main: [0] listen () [saned] main: [1] socket () using IPv6 [saned] main: [1] socket failed: Address family not supported by protocol [saned] main: waiting for control connection [saned] saned (AF-indep+IPv6) from sane-backends 1.0.19 ready [saned] check_host: access by remote host: 192.168.1.239 [saned] check_host: remote host is not IN_LOOPBACK nor IN6_LOOPBACK [saned] check_host: local hostname: ashley [saned] check_host: local hostname(s) (from DNS): ashley.powercraft.nl [saned] check_host: local hostname(s) (from DNS): (null) [saned] check_host: local hostname(s) (from DNS): (null) [saned] check_host: remote host doesn't have same addr as local [saned] check_host: opening config file: /etc/hosts.equiv [saned] check_host: can't open config file: /etc/hosts.equiv (No such file or directory) [saned] check_host: opening config file: saned.conf [saned] check_host: config file line: `192.168.1.0/24' [saned] check_host: subnet with base IP = 192.168.1.0, CIDR netmask = 24 [saned] check_host: access granted from IP address 192.168.1.239 (in subnet 192.168.1.0/24) [saned] init: access granted [saned] init: access granted to jelle@192.168.1.239 [saned] process_request: waiting for request [saned] process_request: got request 1 [sanei_debug] Setting debug level of hp to 128. [hp] sane_init called [hp] hp_init: global.is_up = 1 [hp] sane_init will finish with Success [hp] sane_get_devices called [hp] hp_read_config: hp backend v1.06/$Revision: 1.21 $ starts reading config file [hp] hp_read_config: processing line [hp] hp_read_config: processing line <# Uncomment the following if you have "Error during device I/O" on SCSI> [hp] hp_read_config: processing line <# option dumb-read> [hp] hp_read_config: processing line <#> [hp] hp_read_config: processing line <# The usual place for a SCSI-scanner on Linux> [hp] hp_read_config: processing line [hp] hp_attach_matching_devices: attach matching scsi HP [hp] hp_read_config: processing line <#> [hp] hp_read_config: processing line <# USB-scanners supported by the hp-backend> [hp] hp_read_config: processing line <# HP ScanJet 4100C> [hp] hp_read_config: processing line [hp] hp_attach_matching_devices: attach matching /dev/scanner [hp] hp_attach: "/dev/scanner" [hp] hp_get_dev: New device /dev/scanner, connect-scsi, scsi-request=1 [hp] sanei_hp_device_new: /dev/scanner [hp] hp_GetOpenDevice: device /dev/scanner not open [hp] scsi_new: open failed (Invalid argument) [hp] /dev/scanner: Can't open scsi device [hp] hp_read_config: processing line <# HP ScanJet 5200C> [hp] hp_read_config: processing line [hp] hp_attach_matching_devices: usb attach matching "usb 0x03f0 0x0101" [hp] hp_read_config: processing line <# HP ScanJet 62X0C> [hp] hp_read_config: processing line [hp] hp_attach_matching_devices: usb attach matching "usb 0x03f0 0x0401" [hp] hp_read_config: processing line <# HP ScanJet 63X0C> [hp] hp_read_config: processing line [hp] hp_attach_matching_devices: usb attach matching "usb 0x03f0 0x0201" [hp] hp_read_config: processing line <#> [hp] hp_read_config: processing line <# Uncomment the following if your scanner is connected by USB,> [hp] hp_read_config: processing line <# but you are not using libusb> [hp] hp_read_config: processing line <# /dev/usb/scanner0> [hp] hp_read_config: processing line <# option connect-device> [hp] hp_read_config: attach usb 0x03f0 0x0601 [hp] hp_attach_matching_devices: usb attach matching "usb 0x03f0 0x0601" [hp] hp_read_config: reset to default config [hp] sane_get_devices will finish with Success [saned] process_request: waiting for request [saned] process_request: got request 10 [hp] sane_exit called [hp] hp_destroy: global.is_up = 0 [hp] sane_exit will finish [saned] quit: exiting # on client: scanimage -L device `net:192.168.1.1:hpaio:/usb/Officejet_J5700_series?serial=CN7BOCF3HP04TC' is a Hewlett-Packard Officejet_J5700_series all-in-one ------------------------------------------------------------------------ # on sever: /etc/init.d/xinetd start tail --line=100 --follow /var/log/syslog Sep 24 10:43:42 ashley xinetd[5585]: xinetd Version 2.3.14 started with libwrap loadavg options compiled in. Sep 24 10:43:42 ashley xinetd[5585]: Started working: 1 available service Sep 24 10:44:03 ashley saned[5593]: saned (AF-indep+IPv6) from sane-backends 1.0.19 ready Sep 24 10:44:03 ashley saned[5593]: check_host: access by remote host: 192.168.1.239 Sep 24 10:44:03 ashley saned[5593]: init: access granted to jelle@192.168.1.239 Sep 24 10:44:03 ashley saned[5593]: quit: exiting # on client: 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).