Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I have a USB scale, a USB HID. Currently, when it is plugged in, the permissions only allow the superuser to access it. How can I configure udev to let anybody access this device? I have the vendor and product IDs, but I would like to match it based on the HID type instead.

Right now, I'm having trouble finding any existing rule that applies to this (I grepped for "hidraw" in /lib/udev/rules.d and /etc/udev/rules.d, among other things).

share|improve this question

3 Answers 3

up vote 5 down vote accepted

Normally, this is done by adding to /etc/udev/rules.d a file maybe named 50-usb-scale.conf with contents like this:

SUBSYSTEM=="usb", ATTR{idVendor}=="HEX1", ATTR{idProduct}=="HEX2", MODE="0666"

Where HEX1 and HEX2 are replaced with the vendor and product id respectively.

To match on the Interface type instead, you could try replacing ATTR{idVendor}=="HEX1", ATTR{idProduct}=="HEX2" with a match for bInterfaceClass being 03 (HID):

SUBSYSTEM=="usb", ATTR{bInterfaceClass}=="03", MODE="0666"

But be warned, that will catch mice and keyboards too.

share|improve this answer
    
Did the trick! Thanks! –  erjiang Jan 30 '11 at 0:26
    
On ubuntu 14.04 you have to use MODE:="0666", without the colon, the rule does nothing. –  EdwinW Jul 26 at 14:00

In case you need to change (like me) ttyACM0 permissions, this are my settings:

KERNEL=="ttyACM0", MODE="0777"

It failed when I tried to specify the vendor and product ID. I am not sure why.

share|improve this answer
    
Yeah, the Kernel option works for most HID devices, better than the USB subsystem one –  Muriuki David Apr 22 at 12:35

If its a HIDRAW device, you have to

chmod 0666 /dev/hidrawX

where X is the hid device number, e.g hidraw0. you can do

ls /dev/hid*

to see a list :) Or just do

sudo chmod 0666 /dev/hidraw*

to set for all hidraw devices, probably not recommended.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.