HP scanner permissions

Q I have decided to upgrade from Fedora 8 to Fedora 10. First I downloaded a live CD and booted that. KDE 4 was a bit of a shock, but overall my first impressions were very good. Then I hit a snag. My HP PSC1410 needs hplip, which was not included on the CD. OK - seems an odd thing to do, but I used Yum to install hplip. Then I could set up and use the printer and scanner, but only as root. This is exactly what happened with my Acer One. I'd tried messing with udev rules to change permissions but only managed to break things, so I restored the files. I did get the printer working but not the scanner. That's no big deal with the netbook but it would be a real pain with my main work machine.

Has something significant changed between Fedora 8 and Fedora 10? Or is it merely that 'installing' to an ephemeral live demo causes problems that will go away when I do a full install?

A It sounds like your scanner device is being created with unsuitable permissions. A simple test is to run these two commands, both as root and a normal user.

sane-find-scanner -q
scanimage -L

The first should discover the scanner no matter who runs it, whereas the second can only access the scanner if it has permission. If this one fails as your user, you definitely have a permissions problem.

With USB scanners, the device name varies each time you connect it, so you cannot simply run a chown or chmod command from your startup scripts. You'll have to get dirty with udev, but it's not really that hard. First you need to identify your scanner - you can do this with dmesg, which will include something like this:

usb 2-1: New USB device found,
idVendor=04a9, idProduct=221c
usb 2-1: New USB device strings: Mfr=1,
Product=2, SerialNumber=0
usb 2-1: Product: CanoScan
usb 2-1: Manufacturer: Canon

Or you can use lsusb

Bus 002 Device 002: ID 04a9:221c Canon, Inc.
CanoScan LiDE 60

Or the tool that comes with Sane

% sane-find-scanner -q
found USB scanner (vendor=0x04a9 [Canon],
product=0x221c [CanoScan], chip=GL842) at
libusb:002:002

All of these will give you the vendor and product codes of the scanner. These examples are with a Canon scanner, so you should expect to get different values with your HP. Now you create a udev rule in /etc/udev/rules.d/10-scanner.rules. The name must end in .rules and the leading 10 ensures it's processed before the default rules. Substitute your own numbers in here

ATTR{idVendor}=="04a9", ATTR{idProduct}=="221c", GROUP:="scanner", MODE:="0660"

This makes the scanner device node readable and writeable by members of the scanner group. You then need to create the group and add yourself to it, as root, with

groupadd -r scanner
gpasswd -a USERNAME scanner

Alternatively, if you're the only user of the computer, put your own group name in the udev rule. Udev will pick up the changes immediately; you only need to reconnect or power-cycle your scanner to pick up the new settings. If you made group changes, you will need to logout of the desktop and back in for those to take effect.

Follow us on Identi.ca or Twitter

Username:   Password:
Create Account | About TuxRadar