scanning only works under "sudo"

Chances are that saned doesn't think you're allowed to connect to it. See the Permissions Issues section of the Ubuntu Scanning How-to for details.


I had a similar problem (Ubuntu 11.04 - Natty Narwhal): Scanning as root works fine, scanning as user – no go. scanimage -L and sane-find-scanner found and identified the the scanner correctly, even when run as normal user. `simple-scan -d both as root and normal user didn't show up anything useful in terms of missing group right, missing files or drivers.

Eventually this link worked for me.

The solution was editing these files:

  • /lib/udev/rules.d/40-libsane.rules
  • /etc/udev/rules.d/55-libsane.rules

Not sure if both needed to be edited, I applied all changes as described. Very important: REBOOT after editing.


I solved it by adding this line to /etc/rc.local (before exit 0):

chmod -R a+w /dev/bus/usb

and editing/creating the following 2 files:

/etc/xinetd.d/saned:

service saned 
{
socket_type = stream
server = /usr/sbin/saned
protocol = tcp
user = root
group = root
wait = no
disable = no
}

/etc/default/saned:

# 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=root

then rebooting.

It's working, but I still would like a more secure way of solving this.

Tags:

Ubuntu

Scanner