|
After upgrading to 11.1 (from 11.0) I was no longer able to use my USB scanner as a non-root user. The scanner software (I use vuescan) would say "No scanner was found attached to your computer."
It turned out that the permissions on the USB device were incorrect.
When a USB device is plugged in, the udev dynamic device management system creates a file /dev/bus/usb/<bus>/<device> through which the device can be accessed. This file, by default, is owned by user root, group root, and it gets the permissions 0660. This means that a 'normal' user can't access it.
I don't know much about udev, but I found out that it runs custom scripts at the moment that a device is plugged in. These scripts are located in /etc/udev/rules.d (at least, on openSUSE, other distros may have it located somewhere else). Poking around, I found a script called 55-libsane.rules, which contains rules for a lot of USB scanner devices. And as luck would have it, my device was mentioned in there, it was just commented out.
#ATTR{idVendor}=="0686", ATTR{idProduct}=="400e", MODE="0664", GROUP="lp", ENV{libsane_matched}="yes"
This means that, when udev detects a device type '400e' from vendor '0686', it'll change the devices permissions to 0664 and place it in the group lp (I don't know what the libsane_matched environment variable does, but I don't think it matters here). You can find out the vendor/devices IDs for your scanner by plugging it in and then examining the last lines in /var/log/messages.
To run this udev rule, all I had to do (as root) was:
- edit /etc/udev/rules.d/55-libsane.rules, uncomment the line for my scanner (i.e. remove the '#' at the beginning of the line)
- save and close the file
- restart udev: /etc/init.d/boot.udev restart (not sure if that's really needed, though)
- add my user account to the lp group (using YaST2 or the vigr program)
- log out and log in
Note: if 55-libsane.rules is not present on your system, you can obtain it by installing the package sane-backends. Or you can create your own rules file based on the above rule.
|