Console permissions for USB scanner?
Paul Howarth
paul at city-fan.org
Mon Feb 7 18:29:25 UTC 2005
Thomas Zehetbauer wrote:
> how do I allow console access to a scanner connected via USB/libusb?
>
> After reboot the scanner can be found by sane-find-scanner but cannot be
> used because the device file in /proc/bus/usb is only accessible to
> root. How can I automatically change ownership of this device *without*
> depending on the bus#/device# scheme used in /proc/bus/usb?
Try to locate the entry for your scanner in the sysfs hierarchy as
described at: http://www.reactivated.net/udevrules.php (look in the
"Identifying devices through SYSFS files" section). You should be able
to identify a section that mentions the manufacturer and model number of
your scanner.
You can then add a udev rule that will create a symlink /dev/scannerN to
the correct device entry for your scanner when it is plugged in, by
creating a file /etc/udev/rules.d/10-custom.rules that matches your
scanner. For example, I have an HP ScanJet 3c, and the rule I use is:
BUS="scsi", SYSFS{vendor}="HP*", SYSFS{model}="C2520A*", SYMLINK="scanner%n"
Although my scanner is SCSI, the principle should be the same. Just
change the BUS, SYSFS{vendor} and SYSFS{model} to match your device.
Since the symlink created is called /dev/scannerN (where N is probably
0), the existing set of console rules should cause the device ownership
to be set to the console logged-in user without any further changes.
Paul.
More information about the fedora-list
mailing list