Scanner funktioniert nur als root. Brauche Userzugriff.

Post Reply
Message
Author
sesame

Scanner funktioniert nur als root. Brauche Userzugriff.

#1 Post by sesame »

Hallo,

der CanoScan N670U (USB) wird perfekt unter root erkannt
(http://www.sane-project.org/man/sane-plustek.5.html).

Starte ich sane bzw. xsane als user, sind keine Geräte erreichbar.

Wie kann ich unter Debian einen Userzugriff einrichten?

User avatar
Janka
Posts: 3585
Joined: 11. Feb 2006 19:10

#2 Post by Janka »

Zwei Möglichkeiten:

1. USB-Devicenode auch für den Benutzer freigeben -- erfordert etwas Handarbeit bei udev
2. saned einrichten wie für Parallelportscanner beschrieben (da geht es nur so.)

Ich erklär mal 2., weil ich das auch so gemacht habe.
In /etc/sane.d/dll.conf das Kommentarzeichen beim Eintrag

Code: Select all

net
entfernen.

In /etc/sane.d/net.conf die folgende Zeile hinzufügen

Code: Select all

localhost
In /etc/sane.d/saned.conf die folgenden Zeilen hinzufügen

Code: Select all

localhost
127.0.0.0/8
Nachprüfen, dass es in /etc/services den Eintrag

Code: Select all

sane-port       6566/tcp   # SANE Control Port
gibt. Wenn nicht, hinzufügen.

Im Verzeichnis /etc/xinetd.d eine Datei mit dem Namen sane-port anlegen und folgenden Inhalt reinschreiben:

Code: Select all

service sane-port
{
  socket_type = stream
  port        = 6566
  wait        = no
  user        = root
  group       = root
  server      = /usr/sbin/saned
  disable     = no
}
Wenn es /etc/xinetd.d nicht gibt, direkt rein in /etc/xinetd.conf damit

Danach xinetd die Konfigurationsdateien neu lesen lassen:

Code: Select all

# killall -HUP xinetd
Jetzt können alle lokalen Benutzer auf den Scanner via saned zugreifen.

Janka
Ich vertonne Spam immer in /dev/dsp statt /dev/null.
Ich mag die Schreie.

sesame

#3 Post by sesame »

Danke für die schnelle Antwort.

Habe jetzt alles so nach Anleitung gemacht, bekomme aber als user immer noch keinen Zugriff. :-(

Dann scanne ich erst einmal als root weiter.

Wenn jemand noch eine Idee hat, möge sie hier posten.

User avatar
Janka
Posts: 3585
Joined: 11. Feb 2006 19:10

#4 Post by Janka »

Wenn du es genau nach dieser Anleitung gemacht hast, muss es auch funzen. Du brauchst keine andere Idee, sondern musst den Fehler suchen.

Kannst ja erstmal gucken, ob bei dir überhaupt xinetd läuft. Wenn nicht, starten. /etc/init.d/xinetd start.

Außerdem kannst du auch nachschauen, ob der saned tatsächlich unter /usr/sbin/saned liegt. Bei mir ist das der Fall, muss aber bei dir nicht zwangsläufig auch so sein.

Was liefert "scanimage -L", als Benutzer ausgeführt, zurück?

Janka
Ich vertonne Spam immer in /dev/dsp statt /dev/null.
Ich mag die Schreie.

sesame

#5 Post by sesame »

Der Befehl "scanimage -L" liefert als user

Code: Select all

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).
und als root:

Code: Select all

device `plustek:libusb:001:006' is a Canon CanoScan N670U/N676U/LiDE20 flatbed scanner
zurück.

xinetd läuft und saned ist in /usr/sbin/saned vorhanden.

da kann ich dann nur irgendwas falsch gemacht haben?

ich werde den grund finden und dann posten.
danke für die hilfe.

User avatar
Janka
Posts: 3585
Joined: 11. Feb 2006 19:10

#6 Post by Janka »

Evtl. sperrt eine Firewall-Regel den saned-port? Kannst du saned z.B. per telnet erreichen?

Code: Select all

$ telnet localhost sane-port
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
Janka
Ich vertonne Spam immer in /dev/dsp statt /dev/null.
Ich mag die Schreie.

sesame

#7 Post by sesame »

Jetzt geht's!

habe nochmal alles das gemacht, was ich nun auf
https://lists.uni-koeln.de/pipermail/li ... 11729.html
gefunden habe:

Code: Select all

So wird nun vorgegangen um saned zu verwenden und das Scannen (PP-Scanner) 
auch den Usern zu ermöglichen:

1. saned als root laufen lassen 
(ggf. /etc/xinetd.d/sane-port, /etc/xinetd.d/saned o.ä„. anpassen). 

# /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
{
        port        = 6566
        socket_type = stream
        wait        = no
        user        = root
        group       = saned
        server      = /usr/sbin/saned
}

2. In /etc/sane.d/saned.conf den Zugriff von "localhost" erlauben. 

# /etc/sane.d/saned.conf
#
# The contents of the saned.conf  file  is  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)).
#
localhost

3. In /etc/sane.d/net.conf "localhost" als Server eintragen.

# This is the net config file.  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

4. In /etc/sane.d/dll.conf das "net" Backend aktivieren.

sesame

#8 Post by sesame »

Jetzt geht's!

habe nochmal alles das gemacht, was ich nun auf
https://lists.uni-koeln.de/pipermail/li ... 11729.html
gefunden habe:

Code: Select all

So wird nun vorgegangen um saned zu verwenden und das Scannen (PP-Scanner) 
auch den Usern zu ermöglichen:

1. saned als root laufen lassen 
(ggf. /etc/xinetd.d/sane-port, /etc/xinetd.d/saned o.ä„. anpassen). 

# /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
{
        port        = 6566
        socket_type = stream
        wait        = no
        user        = root
        group       = saned
        server      = /usr/sbin/saned
}

2. In /etc/sane.d/saned.conf den Zugriff von "localhost" erlauben. 

# /etc/sane.d/saned.conf
#
# The contents of the saned.conf  file  is  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)).
#
localhost

3. In /etc/sane.d/net.conf "localhost" als Server eintragen.

# This is the net config file.  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

4. In /etc/sane.d/dll.conf das "net" Backend aktivieren.
Einiges hatte ich schon erledigt. Aber nun geht es :-)
Vielen Dank nochmal.

Post Reply