Author Topic: Sane driving me insane  (Read 5070 times)

0 Members and 1 Guest are viewing this topic.

Online Emegra

  • Hero Member
  • *****
  • Posts: 2130
  • Karma: 47
  • Gender: Male
  • Devilishly Handsome
    • View Profile
    • Awards
Sane driving me insane
« on: April 24, 2013, 08:42:38 pm »
Hi Guys

Over the last few days I've been trying to set up a saned server to share my scanner across the network  following this tutorial https://help.ubuntu.com/community/sane.d%20tutorial

I followed the instructions step by step to the letter but surprise surprise it didn't work, when I run xsane on the client PC I just get "No devices found"

Everything seemed to go as the tutorial said it should except for an error message I get on the final instruction on the server side which is to instruct saned to automatically start on boot.

I'm not sure if this is the sole cause of the problem or what the error means But I've pasted it below in case anyone can shed any light on it


[
Code: [Select]
graeme@Linux3 ~ $ sudo gedit /etc/default/saned
[sudo] password for graeme:
graeme@Linux3 ~ $ sudo gedit /etc/sane.d/saned.conf
graeme@Linux3 ~ $ sudo service saned restart
Restarting SANE network scanner server: saned.
graeme@Linux3 ~ $ sudo update-rc.d saned defaults
update-rc.d: warning: saned stop runlevel arguments (0 1 6) do not match LSB Default-Stop values (1)
 System start/stop links for /etc/init.d/saned already exist.
graeme@Linux3 ~ $ $ sudo service saned status
$: command not found
graeme@Linux3 ~ $

EDIT
 please ignore the last command I entered (sudo service sane status) I pasted it wrong into the terminal I've since checked and saned service is running

Any help would be greatly appreciated

Graeme
« Last Edit: April 24, 2013, 09:32:56 pm by Emegra »
If you can keep your head while all around are losing theirs, then you're not quite grasping the situation

Online Mark Greaves (PCNetSpec)

  • Administrator
  • Hero Member
  • *****
  • Posts: 12436
  • Karma: 306
  • Gender: Male
  • "-rw-rw-rw-" .. The Number Of The Beast
    • View Profile
    • PCNetSpec
    • Awards
Re: Sane driving me insane
« Reply #1 on: April 24, 2013, 09:54:36 pm »
OK, the init script edit is just about autostarting at bootup .. but I'm fairly certain there's a saned init script present anyway (and your output supports this).

First let's check whether it was updated.

REBOOT.

Once back at your desktop, run:
Code: [Select]
sudo service saned status
what's the output ?

--
« Last Edit: April 24, 2013, 09:57:22 pm by Mark Greaves (PCNetSpec) »
WARNING: You are logged into reality as 'root'

logging in as 'insane' is the only safe option.

Offline SeZo

  • Hero Member
  • *****
  • Posts: 1210
  • Karma: 111
  • Gender: Male
    • View Profile
    • Awards
Re: Sane driving me insane
« Reply #2 on: April 24, 2013, 09:56:18 pm »
Are you sure you set the access list to your subnet?
You could check (from client machine) what ports are open (substitute the address with the server ip address)
You may have to install nmap
Code: [Select]
sudo nmap -sS -A 192.168.0.15
Look for something relating to sane in the port range  set in /etc/sane.d/saned.conf
It would be in the following format:
Quote
PORT      STATE SERVICE     VERSION
22/tcp    open  ssh         OpenSSH 5.3p1 Debian 3ubuntu7 (protocol 2.0)

For security reasons please do not replicate the results here.

Online Emegra

  • Hero Member
  • *****
  • Posts: 2130
  • Karma: 47
  • Gender: Male
  • Devilishly Handsome
    • View Profile
    • Awards
Re: Sane driving me insane
« Reply #3 on: April 24, 2013, 10:01:26 pm »
I'm assuming you wanted the output from the server ?

Code: [Select]
graeme@Linux3 ~ $ sudo service saned status
[sudo] password for graeme:
saned is running.
graeme@Linux3 ~ $
If you can keep your head while all around are losing theirs, then you're not quite grasping the situation

Online Emegra

  • Hero Member
  • *****
  • Posts: 2130
  • Karma: 47
  • Gender: Male
  • Devilishly Handsome
    • View Profile
    • Awards
Re: Sane driving me insane
« Reply #4 on: April 24, 2013, 10:06:41 pm »
Hi SeZo :)

chloe@Linux2 ~ $ sudo nmap -sS -A 192.168.2.3
[sudo] password for chloe:
sudo: nmap: command not found
chloe@Linux2 ~ $


#
Quote
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)).
If you can keep your head while all around are losing theirs, then you're not quite grasping the situation

Online Mark Greaves (PCNetSpec)

  • Administrator
  • Hero Member
  • *****
  • Posts: 12436
  • Karma: 306
  • Gender: Male
  • "-rw-rw-rw-" .. The Number Of The Beast
    • View Profile
    • PCNetSpec
    • Awards
Re: Sane driving me insane
« Reply #5 on: April 24, 2013, 10:08:49 pm »
is that saned.conf from the server (with the scanner attached) ?

[EDIT]

you can install nmap with:
Code: [Select]
sudo apt-get install nmap
« Last Edit: April 24, 2013, 10:12:03 pm by Mark Greaves (PCNetSpec) »
WARNING: You are logged into reality as 'root'

logging in as 'insane' is the only safe option.

Online Emegra

  • Hero Member
  • *****
  • Posts: 2130
  • Karma: 47
  • Gender: Male
  • Devilishly Handsome
    • View Profile
    • Awards
Re: Sane driving me insane
« Reply #6 on: April 24, 2013, 10:11:07 pm »
Quote
is that saned.conf from the server (with the scanner attached) ?

No that's from the Client

Graeme (Linux3)=Server
Chloe (Linux2)=Client
If you can keep your head while all around are losing theirs, then you're not quite grasping the situation

Online Mark Greaves (PCNetSpec)

  • Administrator
  • Hero Member
  • *****
  • Posts: 12436
  • Karma: 306
  • Gender: Male
  • "-rw-rw-rw-" .. The Number Of The Beast
    • View Profile
    • PCNetSpec
    • Awards
Re: Sane driving me insane
« Reply #7 on: April 24, 2013, 10:13:12 pm »
Can you post the one from the server.

and you can install nmap (to run SeZo's command) with:
Code: [Select]
sudo apt-get install nmap
WARNING: You are logged into reality as 'root'

logging in as 'insane' is the only safe option.

Online Emegra

  • Hero Member
  • *****
  • Posts: 2130
  • Karma: 47
  • Gender: Male
  • Devilishly Handsome
    • View Profile
    • Awards
Re: Sane driving me insane
« Reply #8 on: April 24, 2013, 10:19:57 pm »
Quote
# 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
 localhost
 127.0.0.1
192.168.2.0/24
# 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: [Select]
graeme@Linux3 ~ $ sudo nmap -sS -A 192.168.2.3

Starting Nmap 5.21 ( http://nmap.org ) at 2013-04-24 22:16 BST
Nmap scan report for 192.168.2.3
Host is up (0.000035s latency).
Not shown: 995 closed ports
PORT      STATE SERVICE     VERSION
139/tcp   open  netbios-ssn Samba smbd 3.X (workgroup: WORKGROUP)
445/tcp   open  netbios-ssn Samba smbd 3.X (workgroup: WORKGROUP)
631/tcp   open  ipp         CUPS 1.5
6566/tcp  open  unknown
10000/tcp open  http        MiniServ 1.610 (Webmin httpd)
|_html-title: Site doesn't have a title (text/html; Charset=iso-8859-1).
No exact OS matches for host (If you know what OS is running on it, see http://nmap.org/submit/ ).
TCP/IP fingerprint:
OS:SCAN(V=5.21%D=4/24%OT=139%CT=1%CU=33164%PV=Y%DS=0%DC=L%G=Y%TM=51784BDB%P
OS:=i686-pc-linux-gnu)SEQ(SP=104%GCD=1%ISR=10A%TI=Z%CI=Z%II=I%TS=8)SEQ(SP=1
OS:04%GCD=2%ISR=10A%TI=Z%CI=Z%II=I%TS=8)OPS(O1=M400CST11NW4%O2=M400CST11NW4
OS:%O3=M400CNNT11NW4%O4=M400CST11NW4%O5=M400CST11NW4%O6=M400CST11)WIN(W1=80
OS:00%W2=8000%W3=8000%W4=8000%W5=8000%W6=8000)ECN(R=Y%DF=Y%T=40%W=8018%O=M4
OS:00CNNSNW4%CC=Y%Q=)T1(R=Y%DF=Y%T=40%S=O%A=S+%F=AS%RD=0%Q=)T2(R=N)T3(R=Y%D
OS:F=Y%T=40%W=8000%S=O%A=S+%F=AS%O=M400CST11NW4%RD=0%Q=)T4(R=Y%DF=Y%T=40%W=
OS:0%S=A%A=Z%F=R%O=%RD=0%Q=)T5(R=Y%DF=Y%T=40%W=0%S=Z%A=S+%F=AR%O=%RD=0%Q=)T
OS:6(R=Y%DF=Y%T=40%W=0%S=A%A=Z%F=R%O=%RD=0%Q=)T7(R=Y%DF=Y%T=40%W=0%S=Z%A=S+
OS:%F=AR%O=%RD=0%Q=)U1(R=Y%DF=N%T=40%IPL=164%UN=0%RIPL=G%RID=G%RIPCK=G%RUCK
OS:=G%RUD=G)IE(R=Y%DFI=N%T=40%CD=S)

Network Distance: 0 hops

Host script results:
|_nbstat: NetBIOS name: LINUX3, NetBIOS user: <unknown>, NetBIOS MAC: <unknown>
|_smbv2-enabled: Server doesn't support SMBv2 protocol
| smb-os-discovery: 
|   OS: Unix (Samba 3.6.3)
|   Name: WORKGROUP\Unknown
|_  System time: 2013-04-24 22:17:15 UTC+1

OS and Service detection performed. Please report any incorrect results at http://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 23.50 seconds
graeme@Linux3 ~ $
If you can keep your head while all around are losing theirs, then you're not quite grasping the situation

Online Mark Greaves (PCNetSpec)

  • Administrator
  • Hero Member
  • *****
  • Posts: 12436
  • Karma: 306
  • Gender: Male
  • "-rw-rw-rw-" .. The Number Of The Beast
    • View Profile
    • PCNetSpec
    • Awards
Re: Sane driving me insane
« Reply #9 on: April 24, 2013, 10:43:33 pm »
Quote
## Access list
localhost
 127.0.0.1

192.168.2.0/24

First, remove the 2 lines in red .. they shouldn't be on the server .. though I doubt if they'd hurt.
WARNING: You are logged into reality as 'root'

logging in as 'insane' is the only safe option.

Offline SeZo

  • Hero Member
  • *****
  • Posts: 1210
  • Karma: 111
  • Gender: Male
    • View Profile
    • Awards
Re: Sane driving me insane
« Reply #10 on: April 24, 2013, 10:45:28 pm »
It appears that the scanner ports are not visible to the network. Is your firewall blocking it?
Also the range is conflicting with the Webmin port too.
Here is a better tutorial which also suggest to modify inetd or xinetd to get it up and running:
http://richardappleby.wordpress.com/2012/07/28/building-a-scan-server-on-ubuntu-server-12-04/
Or you could try adding this line to /etc/services file first:
   
Code: [Select]
sane-port 10100/tcp sane saned # SANE
« Last Edit: April 24, 2013, 10:47:36 pm by SeZo »

Online Mark Greaves (PCNetSpec)

  • Administrator
  • Hero Member
  • *****
  • Posts: 12436
  • Karma: 306
  • Gender: Male
  • "-rw-rw-rw-" .. The Number Of The Beast
    • View Profile
    • PCNetSpec
    • Awards
Re: Sane driving me insane
« Reply #11 on: April 24, 2013, 10:47:02 pm »
I was about to ask about webmin :)
WARNING: You are logged into reality as 'root'

logging in as 'insane' is the only safe option.

Online Emegra

  • Hero Member
  • *****
  • Posts: 2130
  • Karma: 47
  • Gender: Male
  • Devilishly Handsome
    • View Profile
    • Awards
Re: Sane driving me insane
« Reply #12 on: April 24, 2013, 10:51:32 pm »
Quote
First, remove the 2 lines in red .. they shouldn't be on the server .. though I doubt if they'd hurt.

Ok done that (client still won't connect)

I added that line myself as per the troubleshooter on the tutorial, it suggested that xsane would load twice when I typed xsane from the terminal but I only get one instance so I'm not sure what that's telling me
If you can keep your head while all around are losing theirs, then you're not quite grasping the situation

Online Emegra

  • Hero Member
  • *****
  • Posts: 2130
  • Karma: 47
  • Gender: Male
  • Devilishly Handsome
    • View Profile
    • Awards
Re: Sane driving me insane
« Reply #13 on: April 24, 2013, 10:59:26 pm »


I added that line to the service file Client still wont connect  :(

 
Quote
Here is a better tutorial which also suggest to modify inetd or xinetd to get it up and running:

I don't appear to have these files on my pc I've already looked for them
If you can keep your head while all around are losing theirs, then you're not quite grasping the situation

Offline SeZo

  • Hero Member
  • *****
  • Posts: 1210
  • Karma: 111
  • Gender: Male
    • View Profile
    • Awards
Re: Sane driving me insane
« Reply #14 on: April 24, 2013, 11:07:03 pm »
I would suggest to comment out the port range in saned.conf as port 6566/tcp is already allocated to it:
Code: [Select]
cat /etc/services | grep sane
Quote
I don't appear to have these files on my pc I've already looked for them

Inetd or xinetd appear to be not installed by default:
Code: [Select]
sudo apt-get install xinetd

 


SimplePortal 2.3.3 © 2008-2010, SimplePortal